Skip to content

Commit

Permalink
switched to SeqCst atomic ordering in tests (unsure if Relaxed is
Browse files Browse the repository at this point in the history
correct)
  • Loading branch information
gerwin3 committed Mar 21, 2024
1 parent 9a0b8e9 commit f2c2db8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ mod tests {
Future::new({
let first_future_completed = first_future_completed.clone();
move || {
first_future_completed.store(true, Ordering::Relaxed);
first_future_completed.store(true, Ordering::SeqCst);
}
})
.await;
assert!(
Future::new({
let first_future_completed = first_future_completed.clone();
move || first_future_completed.load(Ordering::Relaxed)
move || first_future_completed.load(Ordering::SeqCst)
})
.await
);
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/work.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ mod tests {
let work = Work::new({
let make_me_true = make_me_true.clone();
move || {
make_me_true.store(true, std::sync::atomic::Ordering::Relaxed);
make_me_true.store(true, std::sync::atomic::Ordering::SeqCst);
}
});
work.run();
assert!(make_me_true.load(std::sync::atomic::Ordering::Relaxed));
assert!(make_me_true.load(std::sync::atomic::Ordering::SeqCst));
}
}

0 comments on commit f2c2db8

Please sign in to comment.