We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 54fd9a6 + a0ed5e2 commit c9a46deCopy full SHA for c9a46de
src/tests/mod.rs
@@ -36,7 +36,15 @@ mod setup {
36
set_panic_hook();
37
38
//acquiring a lock on TESTMUTEX prevents other tests from running concurrently
39
- let thelock = TESTMUTEX.lock().unwrap();
+ let thelock = TESTMUTEX.lock().unwrap_or_else(
40
+ |e| {
41
+ //if the lock is poisoned, we need to clear the poison and clean up references to the cage.
42
+ lindrustfinalize();
43
+ //clear the mutex poisoning.
44
+ TESTMUTEX.clear_poison();
45
+ //return the underlying guard.
46
+ e.into_inner()
47
+ });
48
49
interface::RUSTPOSIX_TESTSUITE.store(true, interface::RustAtomicOrdering::Relaxed);
50
0 commit comments