mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
poll: fix interrupted sleep
This commit is contained in:
@@ -110,8 +110,10 @@ int poll_dowait(polldesc_t *desc, size_t ustimeout) {
|
||||
// in the case of sleep being interrupted, wait until poll_event has done everything (if anything)
|
||||
__assert(ret || spinlock_try(&desc->lock) == false);
|
||||
|
||||
if (ret)
|
||||
if (ret == SCHED_WAKEUP_REASON_INTERRUPTED) {
|
||||
spinlock_acquire(&desc->wakeuplock);
|
||||
ret = EINTR;
|
||||
}
|
||||
|
||||
if (ustimeout != 0 && ret != 1) {
|
||||
timer_remove(_cpu()->timer, &sleepentry);
|
||||
|
||||
Reference in New Issue
Block a user