Skip to content

Commit 2dc6ba2

Browse files
committed
std: send free message when xous thread parker is dropped
1 parent 03301f2 commit 2dc6ba2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

library/std/src/sys/xous/thread_parking.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::os::xous::ffi::blocking_scalar;
1+
use crate::os::xous::ffi::{blocking_scalar, scalar};
22
use crate::os::xous::services::{ticktimer_server, TicktimerScalar};
33
use crate::pin::Pin;
44
use crate::ptr;
@@ -86,3 +86,9 @@ impl Parker {
8686
}
8787
}
8888
}
89+
90+
impl Drop for Parker {
91+
fn drop(&mut self) {
92+
scalar(ticktimer_server(), TicktimerScalar::FreeCondition(self.index()).into()).ok();
93+
}
94+
}

0 commit comments

Comments
 (0)