Skip to content

Commit

Permalink
change memory order
Browse files Browse the repository at this point in the history
  • Loading branch information
Toru3 committed Jan 3, 2024
1 parent 9f52f57 commit f63e656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/sys/test_signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ fn test_sigsuspend() {
let _m = crate::SIGNAL_MTX.lock();
static SIGNAL_RECIEVED: AtomicBool = AtomicBool::new(false);
extern "C" fn test_sigsuspend_handler(_: libc::c_int) {
assert!(!SIGNAL_RECIEVED.swap(true, Ordering::SeqCst));
assert!(!SIGNAL_RECIEVED.swap(true, Ordering::AcqRel));
}
thread::spawn(|| {
const SIGNAL: Signal = Signal::SIGUSR1;
Expand All @@ -381,9 +381,9 @@ fn test_sigsuspend() {
let mut not_wait_set = SigSet::all();
not_wait_set.remove(SIGNAL);
// signal handler must run in SigSet::suspend()
assert!(!SIGNAL_RECIEVED.load(Ordering::SeqCst));
assert!(!SIGNAL_RECIEVED.load(Ordering::Acquire));
not_wait_set.suspend().unwrap();
assert!(SIGNAL_RECIEVED.load(Ordering::SeqCst));
assert!(SIGNAL_RECIEVED.load(Ordering::Acquire));

// Restore the signal handler.
unsafe { sigaction(SIGNAL, &old_act) }
Expand Down

0 comments on commit f63e656

Please sign in to comment.