mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-01-30 17:11:47 -05:00
Merge pull request #175 from arihant2math/more-interrupts
Make futex wait interruptable
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::clock::realtime::date;
|
||||
use crate::clock::timespec::TimeSpec;
|
||||
use crate::drivers::timer::sleep;
|
||||
use crate::process::thread_group::signal::{InterruptResult, Interruptable};
|
||||
use crate::sync::{OnceLock, SpinLock};
|
||||
use alloc::boxed::Box;
|
||||
use alloc::{collections::btree_map::BTreeMap, sync::Arc};
|
||||
@@ -119,14 +120,19 @@ pub async fn sys_futex(
|
||||
}
|
||||
};
|
||||
|
||||
do_futex_wait(
|
||||
match do_futex_wait(
|
||||
key,
|
||||
uaddr,
|
||||
val,
|
||||
if cmd == FUTEX_WAIT { u32::MAX } else { val3 },
|
||||
timeout,
|
||||
)
|
||||
.interruptable()
|
||||
.await
|
||||
{
|
||||
InterruptResult::Interrupted => Err(KernelError::Interrupted),
|
||||
InterruptResult::Uninterrupted(v) => v,
|
||||
}
|
||||
}
|
||||
|
||||
FUTEX_WAKE | FUTEX_WAKE_BITSET => Ok(wake_key(
|
||||
|
||||
Reference in New Issue
Block a user