use super::{LockHeldState, LockTestExt};
use std::sync::Arc;
-use std::thread;
#[test]
#[should_panic]
}
#[test]
+#[should_panic]
+#[cfg(not(feature = "backtrace"))]
fn recursive_read() {
let lock = RwLock::new(());
let _a = lock.read().unwrap();
}
}
-#[test]
-fn read_recursive_no_lockorder() {
- // Like the above, but note that no lockorder is implied when we recursively read-lock a
- // RwLock, causing this to pass just fine.
- let a = RwLock::new(());
- let b = RwLock::new(());
- let _outer = a.read().unwrap();
- {
- let _a = a.read().unwrap();
- let _b = b.read().unwrap();
- }
- {
- let _b = b.read().unwrap();
- let _a = a.read().unwrap();
- }
-}
-
#[test]
#[should_panic]
fn read_write_lockorder_fail() {