From fb186a2f2d6ea3851f7e41f7e66a81a0a4f9146f Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 27 Jun 2022 11:44:45 -0400 Subject: [PATCH] make sure a thread is joined --- tests/pass/concurrency/sync_nopreempt.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/pass/concurrency/sync_nopreempt.rs b/tests/pass/concurrency/sync_nopreempt.rs index 391f65ae5a9..b5e726dac7b 100644 --- a/tests/pass/concurrency/sync_nopreempt.rs +++ b/tests/pass/concurrency/sync_nopreempt.rs @@ -46,7 +46,7 @@ fn check_rwlock_unlock_bug1() { // Make a waiting writer. let l2 = l.clone(); - thread::spawn(move || { + let t = thread::spawn(move || { let mut w = l2.write().unwrap(); *w += 1; }); @@ -59,6 +59,7 @@ fn check_rwlock_unlock_bug1() { thread::yield_now(); assert_eq!(*r2, 0); drop(r2); + t.join().unwrap(); } fn check_rwlock_unlock_bug2() {