Support disarming timer
This commit is contained in:
@@ -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>) }
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user