Skip to content

Commit

Permalink
Remove unnecessary condition in Barrier::wait()
Browse files Browse the repository at this point in the history
  • Loading branch information
twetzel59 committed Jul 24, 2021
1 parent 18840b0 commit d65ab29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/sync/barrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d65ab29

Please sign in to comment.