diff --git a/cros_async/src/sync/cv.rs b/cros_async/src/sync/cv.rs index be38a2ee69..4da0a12ef1 100644 --- a/cros_async/src/sync/cv.rs +++ b/cros_async/src/sync/cv.rs @@ -163,11 +163,11 @@ impl Condvar { while (oldstate & SPINLOCK) != 0 || self .state - .compare_exchange( + .compare_exchange_weak( oldstate, oldstate | SPINLOCK | HAS_WAITERS, Ordering::Acquire, - Ordering::Acquire, + Ordering::Relaxed, ) .is_err() { @@ -215,11 +215,11 @@ impl Condvar { while (oldstate & SPINLOCK) != 0 || self .state - .compare_exchange( + .compare_exchange_weak( oldstate, oldstate | SPINLOCK, Ordering::Acquire, - Ordering::Acquire, + Ordering::Relaxed, ) .is_err() { @@ -273,11 +273,11 @@ impl Condvar { while (oldstate & SPINLOCK) != 0 || self .state - .compare_exchange( + .compare_exchange_weak( oldstate, oldstate | SPINLOCK, Ordering::Acquire, - Ordering::Acquire, + Ordering::Relaxed, ) .is_err() {