Skip to content

Commit

Permalink
Remove condvar::two_mutexes test.
Browse files Browse the repository at this point in the history
We don't guarantee this panics. On most platforms it doesn't anymore.
  • Loading branch information
m-ou-se committed May 5, 2022
1 parent 9299e69 commit 21c5f78
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions library/std/src/sync/condvar/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,3 @@ fn wait_timeout_wake() {
break;
}
}

#[test]
#[should_panic]
#[cfg(all(unix, not(target_os = "linux"), not(target_os = "android")))]
fn two_mutexes() {
let m = Arc::new(Mutex::new(()));
let m2 = m.clone();
let c = Arc::new(Condvar::new());
let c2 = c.clone();

let mut g = m.lock().unwrap();
let _t = thread::spawn(move || {
let _g = m2.lock().unwrap();
c2.notify_one();
});
g = c.wait(g).unwrap();
drop(g);

let m = Mutex::new(());
let _ = c.wait(m.lock().unwrap()).unwrap();
}

0 comments on commit 21c5f78

Please sign in to comment.