Skip to content

Commit

Permalink
object: fix futex test
Browse files Browse the repository at this point in the history
  • Loading branch information
wangrunji0408 committed Apr 6, 2020
1 parent 8ee0cf9 commit 6c25ed2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zircon-object/src/signal/futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,10 @@ impl Waiter {
#[cfg(test)]
mod tests {
use super::*;
use core::time::Duration;

#[async_std::test]
async fn wait_async() {
async fn wait() {
static VALUE: AtomicI32 = AtomicI32::new(1);
let futex = Futex::new(&VALUE);

Expand All @@ -294,6 +295,7 @@ mod tests {
{
let futex = futex.clone();
async_std::task::spawn(async move {
async_std::task::sleep(Duration::from_millis(10)).await;
VALUE.store(2, Ordering::SeqCst);
let count = futex.wake(1);
assert_eq!(count, 1);
Expand Down

0 comments on commit 6c25ed2

Please sign in to comment.