diff --git a/src/return_channel.rs b/src/return_channel.rs index 752b87a..7f2fad6 100644 --- a/src/return_channel.rs +++ b/src/return_channel.rs @@ -1,5 +1,6 @@ use std::sync::{Arc, Condvar, Mutex}; +/// Operates similarly to the `oneshot` channel in tokio pub struct ReturnChannel { value: Mutex>, condvar: Condvar, @@ -52,6 +53,7 @@ impl ReturnChannelSender { #[cfg(test)] mod test { pub use super::*; + use std::time::Duration; #[test] fn test_channel_single_thread() { @@ -69,6 +71,7 @@ mod test { let (tx, rx) = ReturnChannel::new(); std::thread::spawn(|| { + std::thread::sleep(Duration::from_millis(500)); tx.send(42); });