Skip to content

Commit c73b50f

Browse files
committed
f note limitation
1 parent dc25cf3 commit c73b50f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/debug_sync.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ impl<T: Sized> Deref for RwLockReadGuard<'_, T> {
213213

214214
impl<T: Sized> Drop for RwLockReadGuard<'_, T> {
215215
fn drop(&mut self) {
216-
if !self.first_lock { return; }
216+
if !self.first_lock {
217+
// Note that its not strictly true that the first taken read lock will get unlocked
218+
// last, but in practice our locks are always taken as RAII, so it should basically
219+
// always be true.
220+
return;
221+
}
217222
MUTEXES_HELD.with(|held| {
218223
held.borrow_mut().remove(&self.mutex.deps);
219224
});

0 commit comments

Comments
 (0)