mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 11:35:46 +00:00
Kernel: Refactor synchronization to better match RE
This commit is contained in:
parent
3a7f539463
commit
1ee7a4d926
23 changed files with 212 additions and 80 deletions
|
@ -30,6 +30,13 @@ public:
|
|||
/// Acquire/lock the object for the specified thread if it is available
|
||||
virtual void Acquire(Thread* thread) = 0;
|
||||
|
||||
/// Signal this object
|
||||
virtual void Signal();
|
||||
|
||||
virtual bool IsSignaled() const {
|
||||
return is_signaled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a thread to wait on this object
|
||||
* @param thread Pointer to thread to add
|
||||
|
@ -60,6 +67,9 @@ public:
|
|||
/// Get a const reference to the waiting threads list for debug use
|
||||
const std::vector<std::shared_ptr<Thread>>& GetWaitingThreads() const;
|
||||
|
||||
protected:
|
||||
bool is_signaled{}; // Tells if this sync object is signalled;
|
||||
|
||||
private:
|
||||
/// Threads waiting for this object to become available
|
||||
std::vector<std::shared_ptr<Thread>> waiting_threads;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue