fix rust notify initialization and test

This commit is contained in:
Chris Copeland 2023-10-10 23:09:50 -07:00
parent 0b2ba56d57
commit 092ced3ecf
Signed by: chrisnc
GPG Key ID: 14550DA72485DF30
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,7 @@ impl Notify {
Notify {
n: UnsafeCell::new(rt_notify {
value,
sem: c_sem_init(&n.sem, 0, 0),
sem: c_sem_init(&n.sem, 0, 1),
}),
_pin_marker: PhantomPinned,
}
@ -134,6 +134,7 @@ mod tests {
notify!(NOTIFY);
NOTIFY.or(u32::MAX);
assert!(NOTIFY.wait_clear(0xFF) == u32::MAX);
NOTIFY.post();
assert!(NOTIFY.wait() == 0xFFFFFF00);
}
}