Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make linux-futex test less flaky #4154

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/pass-dep/concurrency/linux-futex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ fn concurrent_wait_wake() {
static mut DATA: i32 = 0;
static WOKEN: AtomicI32 = AtomicI32::new(0);

let rounds = 50;
let rounds = 64;
for _ in 0..rounds {
unsafe { DATA = 0 }; // Reset
// Suppose the main thread is holding a lock implemented using futex...
Expand Down Expand Up @@ -267,8 +267,7 @@ fn concurrent_wait_wake() {
}
});
// Increase the chance that the other thread actually goes to sleep.
// (5 yields in a loop seem to make that happen around 40% of the time.)
for _ in 0..5 {
for _ in 0..6 {
thread::yield_now();
}

Expand Down
Loading