X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fsync%2Fnostd_sync.rs;h=08d54a939be66ecccb83d30c0569d25f31a523e1;hb=ee9afd315d22151e314aff2ca826561569ac4d03;hp=ee3e375028eba44bbb0ac723b0eb520c398be227;hpb=a1b5a1bba38e0a4ab08603adbcf9e54f27e86f19;p=rust-lightning diff --git a/lightning/src/sync/nostd_sync.rs b/lightning/src/sync/nostd_sync.rs index ee3e3750..08d54a93 100644 --- a/lightning/src/sync/nostd_sync.rs +++ b/lightning/src/sync/nostd_sync.rs @@ -1,51 +1,10 @@ pub use ::alloc::sync::Arc; use core::ops::{Deref, DerefMut}; -use core::time::Duration; use core::cell::{RefCell, Ref, RefMut}; use super::{LockTestExt, LockHeldState}; pub type LockResult = Result; -pub struct Condvar {} - -pub struct WaitTimeoutResult(bool); -impl WaitTimeoutResult { - pub fn timed_out(&self) -> bool { self.0 } -} - -impl Condvar { - pub fn new() -> Condvar { - Condvar { } - } - - pub fn wait<'a, T>(&'a self, guard: MutexGuard<'a, T>) -> LockResult> { - Ok(guard) - } - - #[allow(unused)] - pub fn wait_timeout<'a, T>(&'a self, guard: MutexGuard<'a, T>, _dur: Duration) -> LockResult<(MutexGuard<'a, T>, ())> { - Ok((guard, ())) - } - - pub fn wait_while<'a, T, F: FnMut(&mut T) -> bool>(&'a self, mut guard: MutexGuard<'a, T>, mut condition: F) - -> LockResult> { - assert!(!condition(&mut *guard)); - Ok(guard) - } - - #[allow(unused)] - pub fn wait_timeout_while<'a, T, F: FnMut(&mut T) -> bool>(&'a self, mut guard: MutexGuard<'a, T>, dur: Duration, mut condition: F) - -> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)> { - if condition(&mut *guard) { - Ok((guard, WaitTimeoutResult(true))) - } else { - Ok((guard, WaitTimeoutResult(false))) - } - } - - pub fn notify_all(&self) {} -} - pub struct Mutex { inner: RefCell }