mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 06:58:22 +00:00
poll: explicitly set header to NULL on leave and fix being bound to a cpu after timeout
This commit is contained in:
@@ -67,6 +67,7 @@ void poll_leave(polldesc_t *desc) {
|
|||||||
bool intstate = interrupt_set(false);
|
bool intstate = interrupt_set(false);
|
||||||
spinlock_acquire(&header->lock);
|
spinlock_acquire(&header->lock);
|
||||||
removefromlist(&header->data, &desc->data[i]);
|
removefromlist(&header->data, &desc->data[i]);
|
||||||
|
desc->data[i].header = NULL;
|
||||||
spinlock_release(&header->lock);
|
spinlock_release(&header->lock);
|
||||||
interrupt_set(intstate);
|
interrupt_set(intstate);
|
||||||
}
|
}
|
||||||
@@ -115,7 +116,7 @@ int poll_dowait(polldesc_t *desc, size_t ustimeout) {
|
|||||||
ret = EINTR;
|
ret = EINTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ustimeout != 0 && ret != ETIMEDOUT) {
|
if (ustimeout != 0) {
|
||||||
timer_remove(current_cpu()->timer, &sleepentry);
|
timer_remove(current_cpu()->timer, &sleepentry);
|
||||||
sched_target_cpu(NULL);
|
sched_target_cpu(NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user