|
|
|
@ -67,8 +67,10 @@ SharedPtr<Thread> WaitObject::GetHighestPriorityReadyThread() { |
|
|
|
return candidate; |
|
|
|
} |
|
|
|
|
|
|
|
void WaitObject::WakeupAllWaitingThreads() { |
|
|
|
while (auto thread = GetHighestPriorityReadyThread()) { |
|
|
|
void WaitObject::WakeupWaitingThread(SharedPtr<Thread> thread) { |
|
|
|
if (!thread) |
|
|
|
return; |
|
|
|
|
|
|
|
if (!thread->IsSleepingOnWaitAll()) { |
|
|
|
Acquire(thread.get()); |
|
|
|
} else { |
|
|
|
@ -86,6 +88,11 @@ void WaitObject::WakeupAllWaitingThreads() { |
|
|
|
thread->wait_objects.clear(); |
|
|
|
|
|
|
|
thread->ResumeFromWait(); |
|
|
|
} |
|
|
|
|
|
|
|
void WaitObject::WakeupAllWaitingThreads() { |
|
|
|
while (auto thread = GetHighestPriorityReadyThread()) { |
|
|
|
WakeupWaitingThread(thread); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|