X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fsync%2Fdebug_sync.rs;h=2b75e095380ec09f22d07d4d1bd636dd93e53c61;hb=f3db18487613b24ee8bdde25a0b753aebcdd3be6;hp=b9f015af65697bedea34edaabcede1c9e559bdfd;hpb=c3de782a2baab0c742332bea4783c393edb83311;p=rust-lightning diff --git a/lightning/src/sync/debug_sync.rs b/lightning/src/sync/debug_sync.rs index b9f015af..2b75e095 100644 --- a/lightning/src/sync/debug_sync.rs +++ b/lightning/src/sync/debug_sync.rs @@ -14,7 +14,7 @@ use std::sync::Condvar as StdCondvar; pub use std::sync::WaitTimeoutResult; -use crate::prelude::HashMap; +use crate::prelude::*; use super::{LockTestExt, LockHeldState}; @@ -57,7 +57,7 @@ impl Condvar { thread_local! { /// We track the set of locks currently held by a reference to their `LockMetadata` - static LOCKS_HELD: RefCell>> = RefCell::new(HashMap::new()); + static LOCKS_HELD: RefCell>> = RefCell::new(new_hash_map()); } static LOCK_IDX: AtomicUsize = AtomicUsize::new(0); @@ -113,7 +113,7 @@ impl LockMetadata { let lock_idx = LOCK_IDX.fetch_add(1, Ordering::Relaxed) as u64; let res = Arc::new(LockMetadata { - locked_before: StdMutex::new(HashMap::new()), + locked_before: StdMutex::new(new_hash_map()), lock_idx, _lock_construction_bt: backtrace, }); @@ -122,7 +122,7 @@ impl LockMetadata { { let (lock_constr_location, lock_constr_colno) = locate_call_symbol(&res._lock_construction_bt); - LOCKS_INIT.call_once(|| { unsafe { LOCKS = Some(StdMutex::new(HashMap::new())); } }); + LOCKS_INIT.call_once(|| { unsafe { LOCKS = Some(StdMutex::new(new_hash_map())); } }); let mut locks = unsafe { LOCKS.as_ref() }.unwrap().lock().unwrap(); match locks.entry(lock_constr_location) { hash_map::Entry::Occupied(e) => {