Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion library/std/tests/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,20 @@ nonpoison_and_poison_unwrap_test!(
test_body: {
use locks::Mutex;
use locks::Condvar;
use std::sync::Barrier;

let sent = Mutex::new(false);
let cond = Condvar::new();
let barrier = Barrier::new(2);

thread::scope(|s| {
s.spawn(|| {
barrier.wait();
thread::sleep(Duration::from_secs(2));
maybe_unwrap(sent.set(true));
cond.notify_all();
});

barrier.wait();
let guard = maybe_unwrap(sent.lock());
// If there is internal overflow, this call will return almost
// immediately, before the other thread has reached the `notify_all`
Expand Down
Loading