make sure a thread is joined

This commit is contained in:
Ralf Jung 2022-06-27 11:44:45 -04:00
parent ab88ba4299
commit fb186a2f2d

View File

@ -46,7 +46,7 @@ fn check_rwlock_unlock_bug1() {
// Make a waiting writer. // Make a waiting writer.
let l2 = l.clone(); let l2 = l.clone();
thread::spawn(move || { let t = thread::spawn(move || {
let mut w = l2.write().unwrap(); let mut w = l2.write().unwrap();
*w += 1; *w += 1;
}); });
@ -59,6 +59,7 @@ fn check_rwlock_unlock_bug1() {
thread::yield_now(); thread::yield_now();
assert_eq!(*r2, 0); assert_eq!(*r2, 0);
drop(r2); drop(r2);
t.join().unwrap();
} }
fn check_rwlock_unlock_bug2() { fn check_rwlock_unlock_bug2() {