about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStefan Schindler <dns2utf8@estada.ch>2017-08-01 16:25:36 +0200
committerStefan Schindler <dns2utf8@estada.ch>2017-08-08 22:58:09 +0200
commit702750c538c56905f58b60520dd1e9814ba03a8e (patch)
tree86afe5a1d297e25ebb52adb09a59ed04a0f9f9ec
parent0bf018c58815eed79a279ee6fa98992b8a3639ef (diff)
downloadrust-702750c538c56905f58b60520dd1e9814ba03a8e.tar.gz
rust-702750c538c56905f58b60520dd1e9814ba03a8e.zip
Use explicit wrapping_add to prevent potential unexpected behavior on debug builds
-rw-r--r--src/libstd/sync/barrier.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/sync/barrier.rs b/src/libstd/sync/barrier.rs
index a7b01e49d2b..273c7c1c54a 100644
--- a/src/libstd/sync/barrier.rs
+++ b/src/libstd/sync/barrier.rs
@@ -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)
         }