From c01a9b512aa6243288ce0df7c63a369e4a5ecf1d Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Tue, 19 Mar 2024 19:48:25 -0400 Subject: [PATCH] Loosen atomic orderings --- time/src/util.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/time/src/util.rs b/time/src/util.rs index 857f5f20b..9bb9b0404 100644 --- a/time/src/util.rs +++ b/time/src/util.rs @@ -85,13 +85,13 @@ pub mod local_offset { /// - [`UtcOffset::local_offset_at`](crate::UtcOffset::local_offset_at) /// - [`UtcOffset::current_local_offset`](crate::UtcOffset::current_local_offset) pub unsafe fn set_soundness(soundness: Soundness) { - LOCAL_OFFSET_IS_SOUND.store(soundness == Soundness::Sound, Ordering::SeqCst); + LOCAL_OFFSET_IS_SOUND.store(soundness == Soundness::Sound, Ordering::Release); } /// Obtains the soundness of obtaining the local UTC offset. If it is [`Soundness::Unsound`], /// it is allowed to invoke undefined behavior when obtaining the local UTC offset. pub fn get_soundness() -> Soundness { - match LOCAL_OFFSET_IS_SOUND.load(Ordering::SeqCst) { + match LOCAL_OFFSET_IS_SOUND.load(Ordering::Acquire) { false => Soundness::Unsound, true => Soundness::Sound, }