rustc_data_structures: sync and atomic consistency
Co-authored-by: @lukas-code
This commit is contained in:
parent
64cfc21289
commit
52bd82f522
1 changed files with 6 additions and 6 deletions
|
@ -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…
Add table
Reference in a new issue