Correctly constrain BucketStorage Header's memory ordering (#20507)
This commit is contained in:
parent
0ebd8c53ee
commit
839edd35a4
|
@ -46,13 +46,13 @@ impl Header {
|
||||||
Ok(UID_UNLOCKED)
|
Ok(UID_UNLOCKED)
|
||||||
== self
|
== self
|
||||||
.lock
|
.lock
|
||||||
.compare_exchange(UID_UNLOCKED, uid, Ordering::Acquire, Ordering::Relaxed)
|
.compare_exchange(UID_UNLOCKED, uid, Ordering::AcqRel, Ordering::Relaxed)
|
||||||
}
|
}
|
||||||
fn unlock(&self) -> Uid {
|
fn unlock(&self) -> Uid {
|
||||||
self.lock.swap(UID_UNLOCKED, Ordering::Release)
|
self.lock.swap(UID_UNLOCKED, Ordering::Release)
|
||||||
}
|
}
|
||||||
fn uid(&self) -> Uid {
|
fn uid(&self) -> Uid {
|
||||||
self.lock.load(Ordering::Relaxed)
|
self.lock.load(Ordering::Acquire)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue