|
|
|
@ -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 {
|
|
|
|
@ -87,6 +89,11 @@ void WaitObject::WakeupAllWaitingThreads() {
|
|
|
|
|
|
|
|
|
|
thread->ResumeFromWait();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WaitObject::WakeupAllWaitingThreads() {
|
|
|
|
|
while (auto thread = GetHighestPriorityReadyThread()) {
|
|
|
|
|
WakeupWaitingThread(thread);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const std::vector<SharedPtr<Thread>>& WaitObject::GetWaitingThreads() const {
|
|
|
|
|