Skip to content

Commit

Permalink
make sure a thread is joined
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jun 27, 2022
1 parent ab88ba4 commit fb186a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/pass/concurrency/sync_nopreempt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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() {
Expand Down

0 comments on commit fb186a2

Please sign in to comment.