mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
rustc_data_structures: sync and atomic consistency
Co-authored-by: @lukas-code
This commit is contained in:
parent
64cfc21289
commit
52bd82f522
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user