From 40fc14471debe19f602b2b991dd2849e2b1a8497 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 29 Jul 2021 16:52:46 +0000 Subject: [PATCH] Really start caching by fixing swapped CAS... (#18842) (#18969) (cherry picked from commit 611af87fdb07de9dba14435b432c776bd3176a6d) Co-authored-by: Ryo Onodera --- core/src/broadcast_stage/standard_broadcast_run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/broadcast_stage/standard_broadcast_run.rs b/core/src/broadcast_stage/standard_broadcast_run.rs index 6c0bb12482..9717c22706 100644 --- a/core/src/broadcast_stage/standard_broadcast_run.rs +++ b/core/src/broadcast_stage/standard_broadcast_run.rs @@ -351,7 +351,7 @@ impl StandardBroadcastRun { if now - last > BROADCAST_PEER_UPDATE_INTERVAL_MS && self .last_peer_update - .compare_and_swap(now, last, Ordering::Relaxed) + .compare_and_swap(last, now, Ordering::Relaxed) == last { let mut w_broadcast_peer_cache = self.broadcast_peer_cache.write().unwrap();