Skip to content

Commit 702750c

Browse files
committed
Use explicit wrapping_add to prevent potential unexpected behavior on debug builds
1 parent 0bf018c commit 702750c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sync/barrier.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Barrier {
152152
BarrierWaitResult(false)
153153
} else {
154154
lock.count = 0;
155-
lock.generation_id += 1;
155+
lock.generation_id = lock.generation_id.wrapping_add(1);
156156
self.cvar.notify_all();
157157
BarrierWaitResult(true)
158158
}

0 commit comments

Comments
 (0)