From c6f35401219e32c7d62e106a45637e7f5304723c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 Jul 2020 09:04:11 +0200 Subject: Use relaxed ordering for marks We dont' need this for perf. `Relaxed` ordering is enough here, as we only have one location. I prefer to use minimal ordering, because that makes it easier to reason about the code. --- crates/test_utils/src/mark.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/test_utils') diff --git a/crates/test_utils/src/mark.rs b/crates/test_utils/src/mark.rs index 7c309a894..97f5a93ad 100644 --- a/crates/test_utils/src/mark.rs +++ b/crates/test_utils/src/mark.rs @@ -62,7 +62,7 @@ pub struct MarkChecker { impl MarkChecker { pub fn new(mark: &'static AtomicUsize) -> MarkChecker { - let value_on_entry = mark.load(Ordering::SeqCst); + let value_on_entry = mark.load(Ordering::Relaxed); MarkChecker { mark, value_on_entry } } } @@ -72,7 +72,7 @@ impl Drop for MarkChecker { if std::thread::panicking() { return; } - let value_on_exit = self.mark.load(Ordering::SeqCst); + let value_on_exit = self.mark.load(Ordering::Relaxed); assert!(value_on_exit > self.value_on_entry, "mark was not hit") } } -- cgit v1.2.3