Fix futex lost wakeup

This commit is contained in:
Ruize Tang
2024-11-11 20:41:56 +08:00
committed by Tate, Hongliang Tian
parent 9da6af0394
commit 6c4f56723c
2 changed files with 115 additions and 3 deletions

View File

@ -253,7 +253,9 @@ impl FutexBucket {
}
let item = item_cursor.remove().unwrap();
item.wake();
if !item.wake() {
continue;
}
count += 1;
}
@ -323,8 +325,9 @@ impl FutexItem {
(futex_item, waiter)
}
pub fn wake(&self) {
self.waker.wake_up();
#[must_use]
pub fn wake(&self) -> bool {
self.waker.wake_up()
}
pub fn match_up(&self, another: &Self) -> bool {