We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c76869 commit 0f64588Copy full SHA for 0f64588
tests/condvar.rs
@@ -6,7 +6,7 @@ use async_std::sync::{Condvar, Mutex};
6
use async_std::task::{self, JoinHandle};
7
8
#[test]
9
-fn wait_timeout() {
+fn wait_timeout_with_lock() {
10
task::block_on(async {
11
let pair = Arc::new((Mutex::new(false), Condvar::new()));
12
let pair2 = pair.clone();
@@ -26,6 +26,17 @@ fn wait_timeout() {
26
})
27
}
28
29
+#[test]
30
+fn wait_timeout_without_lock() {
31
+ task::block_on(async {
32
+ let m = Mutex::new(false);
33
+ let c = Condvar::new();
34
+
35
+ let (_, wait_result) = c.wait_timeout(m.lock().await, Duration::from_millis(10)).await;
36
+ assert!(wait_result.timed_out());
37
+ })
38
+}
39
40
41
fn wait_timeout_until_timed_out() {
42
0 commit comments