Skip to content

Commit 4bb8b0e

Browse files
committed
f assert lockorder
1 parent a7d13d8 commit 4bb8b0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3816,6 +3816,8 @@ where
38163816
///
38173817
/// Expects the caller to have a total_consistency_lock read lock.
38183818
fn process_background_events(&self) -> NotifyOption {
3819+
debug_assert_ne!(self.total_consistency_lock.held_by_thread(), LockHeldState::NotHeldByThread);
3820+
38193821
#[cfg(debug_assertions)]
38203822
self.background_events_processed_since_startup.store(true, Ordering::Release);
38213823

@@ -3865,6 +3867,7 @@ where
38653867
#[cfg(any(test, feature = "_test_utils"))]
38663868
/// Process background events, for functional testing
38673869
pub fn test_process_background_events(&self) {
3870+
let _lck = self.total_consistency_lock.read().unwrap();
38683871
let _ = self.process_background_events();
38693872
}
38703873

0 commit comments

Comments
 (0)