diff --git a/src/mutex.rs b/src/mutex.rs index abd5e9a..b9aeccc 100644 --- a/src/mutex.rs +++ b/src/mutex.rs @@ -34,10 +34,12 @@ impl Mutex { // don't use spin loops // but I can't be bothered with the proper solution loop { - if self - .status - .compare_exchange(INIT, ACQUIRED, Ordering::Acquire, Ordering::Relaxed) - { + if self.status.compare_exchange_weak( + INIT, + ACQUIRED, + Ordering::Acquire, + Ordering::Relaxed, + ) { return MutexGuard { mutex: self }; } else { std::hint::spin_loop();