]> git.lizzy.rs Git - rust.git/commitdiff
Make RacyFlag actually work
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 18 Aug 2020 21:51:01 +0000 (23:51 +0200)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 18 Aug 2020 21:51:01 +0000 (23:51 +0200)
crates/stdx/src/lib.rs

index 5d60f02190ce65782ae600902b87436580dc05d7..273b0f55b2c12d102cc831d1713da87bd390f8d8 100644 (file)
@@ -141,7 +141,7 @@ pub fn partition_point<T, P>(slice: &[T], mut pred: P) -> usize
 
 impl RacyFlag {
     pub const fn new() -> RacyFlag {
-        RacyFlag(AtomicUsize::new(0))
+        RacyFlag(AtomicUsize::new(!0))
     }
 
     pub fn get(&self, init: impl FnMut() -> bool) -> bool {