mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 15:02:20 +01:00
rustfmt
: Run on sync/mod.rs
This commit is contained in:
parent
a3de52f847
commit
8746a80977
1 changed files with 16 additions and 5 deletions
|
@ -31,24 +31,35 @@ mod test_lockorder_checks;
|
|||
#[cfg(all(feature = "std", any(ldk_bench, not(test))))]
|
||||
pub(crate) mod fairrwlock;
|
||||
#[cfg(all(feature = "std", any(ldk_bench, not(test))))]
|
||||
pub use {std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}, fairrwlock::FairRwLock};
|
||||
pub use {
|
||||
fairrwlock::FairRwLock,
|
||||
std::sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard},
|
||||
};
|
||||
|
||||
#[cfg(all(feature = "std", any(ldk_bench, not(test))))]
|
||||
mod ext_impl {
|
||||
use super::*;
|
||||
impl<'a, T: 'a> LockTestExt<'a> for Mutex<T> {
|
||||
#[inline]
|
||||
fn held_by_thread(&self) -> LockHeldState { LockHeldState::Unsupported }
|
||||
fn held_by_thread(&self) -> LockHeldState {
|
||||
LockHeldState::Unsupported
|
||||
}
|
||||
type ExclLock = MutexGuard<'a, T>;
|
||||
#[inline]
|
||||
fn unsafe_well_ordered_double_lock_self(&'a self) -> MutexGuard<T> { self.lock().unwrap() }
|
||||
fn unsafe_well_ordered_double_lock_self(&'a self) -> MutexGuard<T> {
|
||||
self.lock().unwrap()
|
||||
}
|
||||
}
|
||||
impl<'a, T: 'a> LockTestExt<'a> for RwLock<T> {
|
||||
#[inline]
|
||||
fn held_by_thread(&self) -> LockHeldState { LockHeldState::Unsupported }
|
||||
fn held_by_thread(&self) -> LockHeldState {
|
||||
LockHeldState::Unsupported
|
||||
}
|
||||
type ExclLock = RwLockWriteGuard<'a, T>;
|
||||
#[inline]
|
||||
fn unsafe_well_ordered_double_lock_self(&'a self) -> RwLockWriteGuard<T> { self.write().unwrap() }
|
||||
fn unsafe_well_ordered_double_lock_self(&'a self) -> RwLockWriteGuard<T> {
|
||||
self.write().unwrap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue