Skip to content

Commit d65ab29

Browse files
committed
Remove unnecessary condition in Barrier::wait()
1 parent 18840b0 commit d65ab29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/std/src/sync/barrier.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl Barrier {
129129
if lock.count < self.num_threads {
130130
// We need a while loop to guard against spurious wakeups.
131131
// https://en.wikipedia.org/wiki/Spurious_wakeup
132-
while local_gen == lock.generation_id && lock.count < self.num_threads {
132+
while local_gen == lock.generation_id {
133133
lock = self.cvar.wait(lock).unwrap();
134134
}
135135
BarrierWaitResult(false)

0 commit comments

Comments
 (0)