diff --git a/src/libcore/atomics.rs b/src/libcore/atomics.rs index 971799acc78..e022fa2c370 100644 --- a/src/libcore/atomics.rs +++ b/src/libcore/atomics.rs @@ -141,7 +141,7 @@ impl AtomicBool { /// /// fn with_lock(spinlock: &Arc, f: || -> ()) { /// // CAS loop until we are able to replace `false` with `true` - /// while spinlock.compare_and_swap(false, true, SeqCst) == false { + /// while spinlock.compare_and_swap(false, true, SeqCst) != false { /// // Since tasks may not be preemptive (if they are green threads) /// // yield to the scheduler to let the other task run. Low level /// // concurrent code needs to take into account Rust's two threading