Correctly constrain BucketStorage Header's memory ordering (#20507)

This commit is contained in:
Brooks Prumo 2021-10-07 13:32:40 -05:00 committed by GitHub
parent 0ebd8c53ee
commit 839edd35a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -46,13 +46,13 @@ impl Header {
Ok(UID_UNLOCKED)
== self
.lock
.compare_exchange(UID_UNLOCKED, uid, Ordering::Acquire, Ordering::Relaxed)
.compare_exchange(UID_UNLOCKED, uid, Ordering::AcqRel, Ordering::Relaxed)
}
fn unlock(&self) -> Uid {
self.lock.swap(UID_UNLOCKED, Ordering::Release)
}
fn uid(&self) -> Uid {
self.lock.load(Ordering::Relaxed)
self.lock.load(Ordering::Acquire)
}
}