Merge pull request #1008 from lightning-signer/2021-07-sync-no-std
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 49af440851bb5e2f8f71b6d9dae30c5a33481e87..22a7982b1de4a26a8136557a01f35685be7eba9e 100644 (file)
@@ -64,7 +64,7 @@ use prelude::*;
 use core::{cmp, mem};
 use core::cell::RefCell;
 use std::io::{Cursor, Read};
-use std::sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
+use sync::{Arc, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard};
 use core::sync::atomic::{AtomicUsize, Ordering};
 use core::time::Duration;
 #[cfg(any(test, feature = "allow_wallclock_use"))]
@@ -4951,7 +4951,7 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
 #[cfg(test)]
 mod tests {
        use ln::channelmanager::PersistenceNotifier;
-       use std::sync::Arc;
+       use sync::Arc;
        use core::sync::atomic::{AtomicBool, Ordering};
        use std::thread;
        use core::time::Duration;
@@ -4959,6 +4959,7 @@ mod tests {
        use ln::features::InitFeatures;
        use ln::msgs::ChannelMessageHandler;
 
+       #[cfg(feature = "std")]
        #[test]
        fn test_wait_timeout() {
                let persistence_notifier = Arc::new(PersistenceNotifier::new());
@@ -5094,7 +5095,7 @@ pub mod bench {
        use bitcoin::hashes::sha256::Hash as Sha256;
        use bitcoin::{Block, BlockHeader, Transaction, TxOut};
 
-       use std::sync::{Arc, Mutex};
+       use sync::{Arc, Mutex};
 
        use test::Bencher;