diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2022-03-03 11:24:20 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2022-03-03 12:09:18 +0100 |
| commit | c021ac35fa68d1d110c07ccf970a49e1f3a89607 (patch) | |
| tree | 1108c2ab7a1d755bf61e442a6bee7ed1304f9c7e /library/std/src/thread | |
| parent | dadf2adbe9bbb528d8d143405014c08341d87187 (diff) | |
| download | rust-c021ac35fa68d1d110c07ccf970a49e1f3a89607.tar.gz rust-c021ac35fa68d1d110c07ccf970a49e1f3a89607.zip | |
Update test.
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/tests.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs index 4f2c81731a3..3323ba36bf3 100644 --- a/library/std/src/thread/tests.rs +++ b/library/std/src/thread/tests.rs @@ -52,7 +52,7 @@ fn test_run_basic() { } #[test] -fn test_is_running() { +fn test_is_finished() { let b = Arc::new(Barrier::new(2)); let t = thread::spawn({ let b = b.clone(); @@ -63,14 +63,14 @@ fn test_is_running() { }); // Thread is definitely running here, since it's still waiting for the barrier. - assert_eq!(t.is_running(), true); + assert_eq!(t.is_finished(), false); // Unblock the barrier. b.wait(); - // Now check that t.is_running() becomes false within a reasonable time. + // Now check that t.is_finished() becomes true within a reasonable time. let start = Instant::now(); - while t.is_running() { + while !t.is_finished() { assert!(start.elapsed() < Duration::from_secs(2)); thread::sleep(Duration::from_millis(15)); } |
