Skip to content

Commit

Permalink
std: send free message when xous thread parker is dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
joboet committed Oct 18, 2023
1 parent 03301f2 commit 2dc6ba2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion library/std/src/sys/xous/thread_parking.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::os::xous::ffi::blocking_scalar;
use crate::os::xous::ffi::{blocking_scalar, scalar};
use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
use crate::pin::Pin;
use crate::ptr;
Expand Down Expand Up @@ -86,3 +86,9 @@ impl Parker {
}
}
}

impl Drop for Parker {
fn drop(&mut self) {
scalar(ticktimer_server(), TicktimerScalar::FreeCondition(self.index()).into()).ok();
}
}

0 comments on commit 2dc6ba2

Please sign in to comment.