SeqCst->{Release,Acquire} in sys_common::thread_local_key.
SeqCst is unnecessary here.
This commit is contained in:
@@ -128,7 +128,7 @@ impl StaticKey {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn key(&self) -> imp::Key {
|
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,
|
KEY_SENTVAL => self.lazy_init() as imp::Key,
|
||||||
n => n as imp::Key,
|
n => n as imp::Key,
|
||||||
}
|
}
|
||||||
@@ -156,8 +156,8 @@ impl StaticKey {
|
|||||||
match self.key.compare_exchange(
|
match self.key.compare_exchange(
|
||||||
KEY_SENTVAL,
|
KEY_SENTVAL,
|
||||||
key as usize,
|
key as usize,
|
||||||
Ordering::SeqCst,
|
Ordering::Release,
|
||||||
Ordering::SeqCst,
|
Ordering::Acquire,
|
||||||
) {
|
) {
|
||||||
// The CAS succeeded, so we've created the actual key
|
// The CAS succeeded, so we've created the actual key
|
||||||
Ok(_) => key as usize,
|
Ok(_) => key as usize,
|
||||||
|
|||||||
Reference in New Issue
Block a user