Skip to content

Commit cc9775e

Browse files
committed
fix(driver): loosen the ordering
1 parent 677d732 commit cc9775e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • compio-driver/src/sys/driver

compio-driver/src/sys/driver/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ impl AwakeFlag {
3939
/// Set the awake flag. It is true before the driver sleeps, and false after
4040
/// it wakes up.
4141
pub fn set(&self) {
42-
self.0.fetch_or(AWAKE, Ordering::SeqCst);
42+
self.0.fetch_or(AWAKE, Ordering::AcqRel);
4343
}
4444

4545
/// Reset the flags. Returns true if it was notified.
4646
pub fn reset(&self) -> bool {
47-
(self.0.swap(IDLE, Ordering::SeqCst) & NOTIFIED) != 0
47+
(self.0.swap(IDLE, Ordering::AcqRel) & NOTIFIED) != 0
4848
}
4949

5050
/// Set the notified flag. Returns true if the awake flag is set or the
5151
/// notified flag is set. If the awake flag is not set, the driver needs
5252
/// to be notified through a syscall.
5353
pub fn wake(&self) -> bool {
54-
self.0.fetch_or(NOTIFIED, Ordering::SeqCst) != 0
54+
self.0.fetch_or(NOTIFIED, Ordering::AcqRel) != 0
5555
}
5656
}

0 commit comments

Comments
 (0)