about summary refs log tree commit diff
diff options
context:
space:
mode:
authortwetzel59 <twetzel59@gmail.com>2021-07-24 15:54:58 -0400
committertwetzel59 <twetzel59@gmail.com>2021-07-24 15:54:58 -0400
commitd65ab29e2e67bfc329c606923130d6bf5a518800 (patch)
tree257b4bacbd1fa659bc488209ad0d9a8cd6a8cc38
parent18840b0719aa766a1bc49ea2eb5dc2e4cde7da3f (diff)
downloadrust-d65ab29e2e67bfc329c606923130d6bf5a518800.tar.gz
rust-d65ab29e2e67bfc329c606923130d6bf5a518800.zip
Remove unnecessary condition in Barrier::wait()
-rw-r--r--library/std/src/sync/barrier.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs
index a17b82f82e8..bc560806051 100644
--- a/library/std/src/sync/barrier.rs
+++ b/library/std/src/sync/barrier.rs
@@ -129,7 +129,7 @@ impl Barrier {
         if lock.count < self.num_threads {
             // We need a while loop to guard against spurious wakeups.
             // https://en.wikipedia.org/wiki/Spurious_wakeup
-            while local_gen == lock.generation_id && lock.count < self.num_threads {
+            while local_gen == lock.generation_id {
                 lock = self.cvar.wait(lock).unwrap();
             }
             BarrierWaitResult(false)