Skip to content

Commit 4583d6d

Browse files
committed
Adjust atomics in the lio_listio doc test
Since changing the compiler version, this test has begun to occasionally hang in CI. And it's not just in QEMU. It's probably due to an atomic ordering problem.
1 parent a957d16 commit 4583d6d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sys/aio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,12 +1154,12 @@ pub fn aio_suspend(
11541154
/// pub static SIGNALED: AtomicBool = AtomicBool::new(false);
11551155
///
11561156
/// extern fn sigfunc(_: c_int) {
1157-
/// SIGNALED.store(true, Ordering::Relaxed);
1157+
/// SIGNALED.store(true, Ordering::Release);
11581158
/// }
11591159
/// let sa = SigAction::new(SigHandler::Handler(sigfunc),
11601160
/// SaFlags::SA_RESETHAND,
11611161
/// SigSet::empty());
1162-
/// SIGNALED.store(false, Ordering::Relaxed);
1162+
/// SIGNALED.store(false, Ordering::Release);
11631163
/// unsafe { sigaction(Signal::SIGUSR2, &sa) }.unwrap();
11641164
///
11651165
/// const WBUF: &[u8] = b"abcdef123456";
@@ -1173,7 +1173,7 @@ pub fn aio_suspend(
11731173
/// ));
11741174
/// let sev = SigevNotify::SigevSignal { signal: Signal::SIGUSR2, si_value: 0 };
11751175
/// lio_listio(LioMode::LIO_NOWAIT, &mut[aiow.as_mut()], sev).unwrap();
1176-
/// while !SIGNALED.load(Ordering::Relaxed) {
1176+
/// while !SIGNALED.load(Ordering::Acquire) {
11771177
/// thread::sleep(time::Duration::from_millis(10));
11781178
/// }
11791179
/// // At this point, since `lio_listio` returned success and delivered its

0 commit comments

Comments
 (0)