Skip to content

Commit 5e2f277

Browse files
committed
make Apple futex test not depend on scheduler behaviour
1 parent a9ca270 commit 5e2f277

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/pass-dep/concurrency/apple-futex.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@only-target: darwin
2+
//@compile-flags: -Zmiri-preemption-rate=0
23

34
use std::time::{Duration, Instant};
45
use std::{io, ptr, thread};
@@ -173,7 +174,7 @@ fn wait_wake_multiple() {
173174
);
174175
});
175176

176-
thread::sleep(Duration::from_millis(200));
177+
thread::yield_now();
177178
}
178179

179180
// Wake the threads up again.
@@ -230,7 +231,7 @@ fn param_mismatch() {
230231
});
231232

232233
s.spawn(|| {
233-
thread::sleep(Duration::from_millis(200));
234+
thread::yield_now();
234235
unsafe {
235236
assert_eq!(
236237
libc::os_sync_wait_on_address(
@@ -246,7 +247,8 @@ fn param_mismatch() {
246247
}
247248
});
248249

249-
thread::sleep(Duration::from_millis(200));
250+
thread::yield_now();
251+
250252
unsafe {
251253
assert_eq!(
252254
libc::os_sync_wake_by_address_any(

0 commit comments

Comments
 (0)