Add a `payment_metadata` field to `RecipientOnionFields`
[rust-lightning] / lightning / src / sync / nostd_sync.rs
index 858f60db5b5b46a5bb703f2d454d8d2b2c1f2934..08d54a939be66ecccb83d30c0569d25f31a523e1 100644 (file)
@@ -1,30 +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<Guard> = Result<Guard, ()>;
 
-pub struct Condvar {}
-
-impl Condvar {
-       pub fn new() -> Condvar {
-               Condvar { }
-       }
-
-       pub fn wait<'a, T>(&'a self, guard: MutexGuard<'a, T>) -> LockResult<MutexGuard<'a, T>> {
-               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 notify_all(&self) {}
-}
-
 pub struct Mutex<T: ?Sized> {
        inner: RefCell<T>
 }
@@ -60,6 +40,10 @@ impl<T> Mutex<T> {
        pub fn try_lock<'a>(&'a self) -> LockResult<MutexGuard<'a, T>> {
                Ok(MutexGuard { lock: self.inner.borrow_mut() })
        }
+
+       pub fn into_inner(self) -> LockResult<T> {
+               Ok(self.inner.into_inner())
+       }
 }
 
 impl<'a, T: 'a> LockTestExt<'a> for Mutex<T> {