From b493f02c3d173d7d2373da0cbb3e00ea1f55c78e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 13 May 2023 09:56:31 -0700 Subject: [PATCH] put relaxed back --- latency/src/peak_ewma/rtt_estimate.rs | 4 ++-- latency/src/util/atomic_f32_pair.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/latency/src/peak_ewma/rtt_estimate.rs b/latency/src/peak_ewma/rtt_estimate.rs index c169ea4a..be56fe9c 100644 --- a/latency/src/peak_ewma/rtt_estimate.rs +++ b/latency/src/peak_ewma/rtt_estimate.rs @@ -97,7 +97,7 @@ impl AtomicRttEstimate { /// This method omits the ordering argument since loads may use /// slightly stale data to avoid adding additional latency. pub fn load(&self) -> RttEstimate { - RttEstimate::from_pair(self.pair.load(Ordering::Acquire), self.start_time) + RttEstimate::from_pair(self.pair.load(Ordering::Relaxed), self.start_time) } /// Fetches the value, and applies a function to it that returns an @@ -114,7 +114,7 @@ impl AtomicRttEstimate { let mut update_at = Instant::now(); let mut rtt = Duration::ZERO; self.pair - .fetch_update(Ordering::Release, Ordering::Acquire, |pair| { + .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |pair| { rtt = f(RttEstimate::from_pair(pair, self.start_time)); // Save the new update_at inside the function in case it // is run multiple times diff --git a/latency/src/util/atomic_f32_pair.rs b/latency/src/util/atomic_f32_pair.rs index 18b356c3..fa74fa0b 100644 --- a/latency/src/util/atomic_f32_pair.rs +++ b/latency/src/util/atomic_f32_pair.rs @@ -69,7 +69,7 @@ mod tests { fn test_atomic_f32_pair_load() { let pair = [f32::consts::PI, f32::consts::E]; let atomic = AtomicF32Pair::new(pair); - assert_eq!(pair, atomic.load(Ordering::Acquire)); + assert_eq!(pair, atomic.load(Ordering::Relaxed)); } #[test] @@ -77,13 +77,13 @@ mod tests { let pair = [f32::consts::PI, f32::consts::E]; let atomic = AtomicF32Pair::new(pair); atomic - .fetch_update(Ordering::Release, Ordering::Acquire, |[f1, f2]| { + .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |[f1, f2]| { Some([f1 + 1.0, f2 + 1.0]) }) .unwrap(); assert_eq!( [pair[0] + 1.0, pair[1] + 1.0], - atomic.load(Ordering::Acquire) + atomic.load(Ordering::Relaxed) ); } }