From 78a3cefc45d74b4a8d2c8b688a273fcd3b729c6d Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Fri, 28 Jan 2022 18:19:35 +0300 Subject: [PATCH] Use `compare_exchange_weak` in `limit::Limit::check` --- crates/limit/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/limit/src/lib.rs b/crates/limit/src/lib.rs index ace7ef7239b..12228e105c1 100644 --- a/crates/limit/src/lib.rs +++ b/crates/limit/src/lib.rs @@ -45,7 +45,7 @@ pub fn check(&self, other: usize) -> Result<(), ()> { } if self .max - .compare_exchange(old_max, other, Ordering::Relaxed, Ordering::Relaxed) + .compare_exchange_weak(old_max, other, Ordering::Relaxed, Ordering::Relaxed) .is_ok() { eprintln!("new max: {}", other);