Skip to content

Commit d459767

Browse files
committed
f more debug when we do a double lock
1 parent bd6bb1a commit d459767

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/sync/debug_sync.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ impl LockMetadata {
135135
// instances of the same lock. Still, doing so is quite risky, a total order
136136
// must be maintained, and doing so across a set of otherwise-identical mutexes
137137
// is fraught with issues.
138-
debug_assert!(cfg!(feature = "backtrace") && double_lock_self_allowed, "Tried to acquire a lock while it was held!");
138+
#[cfg(feature = "backtrace")]
139+
debug_assert!(double_lock_self_allowed,
140+
"Tried to acquire a lock while it was held!\nLock constructed at {}",
141+
get_construction_location(&this._lock_construction_bt));
142+
#[cfg(not(feature = "backtrace"))]
143+
panic!("Tried to acquire a lock while it was held!");
139144
}
140145
}
141146
for (locked_idx, locked) in held.borrow().iter() {

0 commit comments

Comments
 (0)