WaitSynchronizationN: Implement return values
This commit is contained in:
parent
e4a5d8ad4f
commit
7faf2d8e06
10 changed files with 193 additions and 87 deletions
|
@ -30,13 +30,13 @@ void WaitObject::RemoveWaitingThread(Thread* thread) {
|
|||
waiting_threads.erase(itr);
|
||||
}
|
||||
|
||||
Thread* WaitObject::ResumeNextThread() {
|
||||
Thread* WaitObject::ReleaseNextThread() {
|
||||
if (waiting_threads.empty())
|
||||
return nullptr;
|
||||
|
||||
auto next_thread = waiting_threads.front();
|
||||
|
||||
next_thread->ResumeFromWait();
|
||||
next_thread->ReleaseFromWait(this);
|
||||
waiting_threads.erase(waiting_threads.begin());
|
||||
|
||||
return next_thread.get();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue