Fix WaitChannel_Wake to do nothing if there's no threads to wake up.
This commit is contained in:
parent
d3349d9eaa
commit
72341c3c8b
@ -92,9 +92,11 @@ WaitChannel_Wake(WaitChannel *wchan)
|
|||||||
Spinlock_Lock(&wchan->lock);
|
Spinlock_Lock(&wchan->lock);
|
||||||
|
|
||||||
thr = TAILQ_FIRST(&wchan->chanQueue);
|
thr = TAILQ_FIRST(&wchan->chanQueue);
|
||||||
TAILQ_REMOVE(&wchan->chanQueue, thr, chanQueue);
|
if (thr != NULL) {
|
||||||
Sched_SetRunnable(thr);
|
TAILQ_REMOVE(&wchan->chanQueue, thr, chanQueue);
|
||||||
Thread_Release(thr);
|
Sched_SetRunnable(thr);
|
||||||
|
Thread_Release(thr);
|
||||||
|
}
|
||||||
|
|
||||||
Spinlock_Unlock(&wchan->lock);
|
Spinlock_Unlock(&wchan->lock);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user