Low-level synchronization, semaphore, lock-order debugging, and interruptible thread utilities modelled after Bitcoin Core, built on parking_lot and tracing.
// ---------------- [ File: bitcoin-sync/src/lock_api.rs ]
crate::ix!();/// Minimal trait representing the operations we need
/// from a raw, non‑poisoning mutex.
pubtraitLockApi{fnlock(&self);fnunlock(&self);fntry_lock(&self)->bool;}implLockApi forparking_lot::RawMutex{#[inline]fnlock(&self){// call the low‑level `RawMutexTrait` implementation explicitly
bitcoin_imports::RawMutexTrait::lock(self)}#[inline]fnunlock(&self){unsafe{bitcoin_imports::RawMutexTrait::unlock(self)}}#[inline]fntry_lock(&self)->bool{bitcoin_imports::RawMutexTrait::try_lock(self)}}