From b2948d1872b34f61c8c532d3b5f1719371da8639 Mon Sep 17 00:00:00 2001 From: David Senk Date: Sat, 14 Jun 2025 22:37:52 -0400 Subject: [PATCH] added delay to test --- src/return_channel.rs | 3 +++ 1 file changed, 3 insertions(+) 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); });