You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For each mutex which is currently locked, check that no mutex's locked-before
82
-
// set includes the mutex we're about to lock, which would imply a lockorder
80
+
LOCKS_HELD.with(|held| {
81
+
// For each lock which is currently locked, check that no lock's locked-before
82
+
// set includes the lock we're about to lock, which would imply a lockorder
83
83
// inversion.
84
84
for locked in held.borrow().iter(){
85
85
if read && *locked == *this {
@@ -89,17 +89,17 @@ impl MutexMetadata {
89
89
}
90
90
for locked in held.borrow().iter(){
91
91
if !read && *locked == *this {
92
-
panic!("Tried to lock a mutex while it was held!");
92
+
panic!("Tried to lock a lock while it was held!");
93
93
}
94
94
for locked_dep in locked.locked_before.lock().unwrap().iter(){
95
95
if*locked_dep == *this {
96
96
#[cfg(feature = "backtrace")]
97
-
panic!("Tried to violate existing lockorder.\nMutex that should be locked after the current lock was created at the following backtrace.\nNote that to get a backtrace for the lockorder violation, you should set RUST_BACKTRACE=1\n{:?}", locked.mutex_construction_bt);
97
+
panic!("Tried to violate existing lockorder.\nMutex that should be locked after the current lock was created at the following backtrace.\nNote that to get a backtrace for the lockorder violation, you should set RUST_BACKTRACE=1\n{:?}", locked.lock_construction_bt);
98
98
#[cfg(not(feature = "backtrace"))]
99
99
panic!("Tried to violate existing lockorder. Build with the backtrace feature for more info.");
100
100
}
101
101
}
102
-
// Insert any already-held mutexes in our locked-before set.
102
+
// Insert any already-held locks in our locked-before set.
0 commit comments