summary refs log tree commit diff
path: root/library/std/src/sys_common
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2024-03-19 15:03:29 +0100
committerMara Bos <m-ou.se@m-ou.se>2024-03-19 15:27:11 +0100
commite43aef0ef9cc9d2d12c138b36fd817f7c41d0152 (patch)
treeab683a6ac2283cbf0b14b1077804417ae78af3a2 /library/std/src/sys_common
parent516684c22ec3819c6ef772407bd6d50d8387dafb (diff)
downloadrust-e43aef0ef9cc9d2d12c138b36fd817f7c41d0152.tar.gz
rust-e43aef0ef9cc9d2d12c138b36fd817f7c41d0152.zip
SeqCst->{Release,Acquire} in sys_common::thread_local_key.
SeqCst is unnecessary here.
Diffstat (limited to 'library/std/src/sys_common')
-rw-r--r--library/std/src/sys_common/thread_local_key.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys_common/thread_local_key.rs b/library/std/src/sys_common/thread_local_key.rs
index 204834984a2..7dcc1141099 100644
--- a/library/std/src/sys_common/thread_local_key.rs
+++ b/library/std/src/sys_common/thread_local_key.rs
@@ -128,7 +128,7 @@ impl StaticKey {
 
     #[inline]
     unsafe fn key(&self) -> imp::Key {
-        match self.key.load(Ordering::Relaxed) {
+        match self.key.load(Ordering::Acquire) {
             KEY_SENTVAL => self.lazy_init() as imp::Key,
             n => n as imp::Key,
         }
@@ -156,8 +156,8 @@ impl StaticKey {
         match self.key.compare_exchange(
             KEY_SENTVAL,
             key as usize,
-            Ordering::SeqCst,
-            Ordering::SeqCst,
+            Ordering::Release,
+            Ordering::Acquire,
         ) {
             // The CAS succeeded, so we've created the actual key
             Ok(_) => key as usize,