We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 516684c commit e43aef0Copy full SHA for e43aef0
library/std/src/sys_common/thread_local_key.rs
@@ -128,7 +128,7 @@ impl StaticKey {
128
129
#[inline]
130
unsafe fn key(&self) -> imp::Key {
131
- match self.key.load(Ordering::Relaxed) {
+ match self.key.load(Ordering::Acquire) {
132
KEY_SENTVAL => self.lazy_init() as imp::Key,
133
n => n as imp::Key,
134
}
@@ -156,8 +156,8 @@ impl StaticKey {
156
match self.key.compare_exchange(
157
KEY_SENTVAL,
158
key as usize,
159
- Ordering::SeqCst,
160
+ Ordering::Release,
+ Ordering::Acquire,
161
) {
162
// The CAS succeeded, so we've created the actual key
163
Ok(_) => key as usize,
0 commit comments