Skip to content

Commit c021ac3

Browse files
committed
Update test.
1 parent dadf2ad commit c021ac3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/thread/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn test_run_basic() {
5252
}
5353

5454
#[test]
55-
fn test_is_running() {
55+
fn test_is_finished() {
5656
let b = Arc::new(Barrier::new(2));
5757
let t = thread::spawn({
5858
let b = b.clone();
@@ -63,14 +63,14 @@ fn test_is_running() {
6363
});
6464

6565
// Thread is definitely running here, since it's still waiting for the barrier.
66-
assert_eq!(t.is_running(), true);
66+
assert_eq!(t.is_finished(), false);
6767

6868
// Unblock the barrier.
6969
b.wait();
7070

71-
// Now check that t.is_running() becomes false within a reasonable time.
71+
// Now check that t.is_finished() becomes true within a reasonable time.
7272
let start = Instant::now();
73-
while t.is_running() {
73+
while !t.is_finished() {
7474
assert!(start.elapsed() < Duration::from_secs(2));
7575
thread::sleep(Duration::from_millis(15));
7676
}

0 commit comments

Comments
 (0)