rustc_data_structures: sync and atomic consistency

Co-authored-by: @lukas-code
This commit is contained in:
Michael Howell 2023-05-25 15:18:05 -07:00
parent 64cfc21289
commit 52bd82f522

View File

@ -139,14 +139,14 @@ cfg_if! {
impl Atomic<bool> {
pub fn fetch_or(&self, val: bool, _: Ordering) -> bool {
let result = self.0.get() | val;
self.0.set(val);
result
let old = self.0.get();
self.0.set(val | old);
old
}
pub fn fetch_and(&self, val: bool, _: Ordering) -> bool {
let result = self.0.get() & val;
self.0.set(val);
result
let old = self.0.get();
self.0.set(val & old);
old
}
}