diff options
author | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2021-11-27 13:50:29 -0600 |
---|---|---|
committer | Ryan Zoeller <rtzoeller@rtzoeller.com> | 2021-11-27 13:50:29 -0600 |
commit | 09bddc36769b4be38b6ce567c3352e2934204771 (patch) | |
tree | 679be22f4cdb6c9775b2da67551bca55c61900bc /test/sys/test_select.rs | |
parent | b91bce3113c79728e84b1a24a565b5cac6333f52 (diff) | |
download | nix-09bddc36769b4be38b6ce567c3352e2934204771.zip |
Avoid lock poisoning by using parking_lot
parking_lot provides synchronization primitives which aren't
poisoned on panic. This makes it easier to determine which tests
are failing, as a test failure no longer causes all subsequent tests
using that mutex to fail.
Diffstat (limited to 'test/sys/test_select.rs')
-rw-r--r-- | test/sys/test_select.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/test/sys/test_select.rs b/test/sys/test_select.rs index db079456..2f7396b1 100644 --- a/test/sys/test_select.rs +++ b/test/sys/test_select.rs @@ -5,9 +5,7 @@ use nix::sys::time::{TimeSpec, TimeValLike}; #[test] pub fn test_pselect() { - let _mtx = crate::SIGNAL_MTX - .lock() - .expect("Mutex got poisoned by another test"); + let _mtx = crate::SIGNAL_MTX.lock(); let (r1, w1) = pipe().unwrap(); write(w1, b"hi!").unwrap(); |