Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2b35dd5

Browse files
committed
linux-futex test: ensure we join all threads
1 parent aa68111 commit 2b35dd5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/pass/concurrency/linux-futex.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn wait_wake() {
132132

133133
static FUTEX: i32 = 0;
134134

135-
thread::spawn(move || {
135+
let t = thread::spawn(move || {
136136
thread::sleep(Duration::from_millis(200));
137137
unsafe {
138138
assert_eq!(libc::syscall(
@@ -155,14 +155,15 @@ fn wait_wake() {
155155
}
156156

157157
assert!((200..1000).contains(&start.elapsed().as_millis()));
158+
t.join().unwrap();
158159
}
159160

160161
fn wait_wake_bitset() {
161162
let start = Instant::now();
162163

163164
static FUTEX: i32 = 0;
164165

165-
thread::spawn(move || {
166+
let t = thread::spawn(move || {
166167
thread::sleep(Duration::from_millis(200));
167168
unsafe {
168169
assert_eq!(libc::syscall(
@@ -202,6 +203,7 @@ fn wait_wake_bitset() {
202203
}
203204

204205
assert!((400..1000).contains(&start.elapsed().as_millis()));
206+
t.join().unwrap();
205207
}
206208

207209
fn main() {

0 commit comments

Comments
 (0)