Support disarming timer

This commit is contained in:
Wildan M
2026-05-03 05:06:25 +07:00
parent 9188a9e354
commit ea667cdca1
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -64,6 +64,7 @@ pub(crate) struct timer_internal_t {
pub process_pid: platform::types::pid_t,
}
#[cfg(target_os = "redox")]
impl timer_internal_t {
pub unsafe fn from_raw(timerid: timer_t) -> &'static Mutex<Self> {
unsafe { &*(timerid as *const Mutex<Self>) }
+5
View File
@@ -1392,6 +1392,11 @@ impl Pal for Sys {
Self::timer_gettime(timerid, ovalue)?;
}
if value.it_value.is_zero() {
timer_st.next_wake_version += 1;
return Ok(());
}
timer_st.next_wake_time = {
let mut val = value.clone();
if flags & TIMER_ABSTIME == 0 {