Skip to content

Commit

Permalink
small test update
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhitc committed May 31, 2022
1 parent fdb063c commit ef12b00
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ mod tests {
let mutex = Arc::new(Mutex::new(0));
let cv = Arc::new(Condvar::new());

let num_iters = u32::MAX;
let num_iters = 3;
let condition = |counter: &mut u32| {
*counter += 1;
true
Expand All @@ -771,9 +771,7 @@ mod tests {
cv.wait_while_until_internal(&mut mutex_guard, condition, timeout);

assert!(timeout_result.timed_out());
// thread should be blocked + woken up multiple times
assert!(*mutex_guard > 2);
assert!(*mutex_guard < num_iters);
assert!(*mutex_guard == num_iters + 1);

// prevent deadlock with notifier
drop(mutex_guard);
Expand Down

0 comments on commit ef12b00

Please sign in to comment.