diff options
| author | joboet <jonasboettiger@icloud.com> | 2023-10-18 16:21:21 +0200 |
|---|---|---|
| committer | joboet <jonasboettiger@icloud.com> | 2023-10-18 16:21:21 +0200 |
| commit | 2dc6ba27b5bbb4b5aca064d007b8305636422c5d (patch) | |
| tree | d2648b09a860102c020c2192bf35003c96407255 | |
| parent | 03301f24ab3f7fefafff192b3c468f6af1213e7b (diff) | |
| download | rust-2dc6ba27b5bbb4b5aca064d007b8305636422c5d.tar.gz rust-2dc6ba27b5bbb4b5aca064d007b8305636422c5d.zip | |
std: send free message when xous thread parker is dropped
| -rw-r--r-- | library/std/src/sys/xous/thread_parking.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/std/src/sys/xous/thread_parking.rs b/library/std/src/sys/xous/thread_parking.rs index 3e77ecf0c73..aa39c6d2718 100644 --- a/library/std/src/sys/xous/thread_parking.rs +++ b/library/std/src/sys/xous/thread_parking.rs @@ -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; @@ -86,3 +86,9 @@ impl Parker { } } } + +impl Drop for Parker { + fn drop(&mut self) { + scalar(ticktimer_server(), TicktimerScalar::FreeCondition(self.index()).into()).ok(); + } +} |
