From d65ab29e2e67bfc329c606923130d6bf5a518800 Mon Sep 17 00:00:00 2001 From: twetzel59 Date: Sat, 24 Jul 2021 15:54:58 -0400 Subject: [PATCH] Remove unnecessary condition in Barrier::wait() --- library/std/src/sync/barrier.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sync/barrier.rs b/library/std/src/sync/barrier.rs index a17b82f82e8c2..bc560806051dc 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)