Skip to content

Commit

Permalink
Use explicit wrapping_add to prevent potential unexpected behavior on…
Browse files Browse the repository at this point in the history
… debug builds
  • Loading branch information
dns2utf8 committed Aug 8, 2017
1 parent 0bf018c commit 702750c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/sync/barrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl Barrier {
BarrierWaitResult(false)
} else {
lock.count = 0;
lock.generation_id += 1;
lock.generation_id = lock.generation_id.wrapping_add(1);
self.cvar.notify_all();
BarrierWaitResult(true)
}
Expand Down

0 comments on commit 702750c

Please sign in to comment.