Skip to content

Commit c2de81f

Browse files
committed
Auto merge of #43588 - dns2utf8:wrapping_add, r=sfackler
Use explicit wrapping_add … … to prevent potential unexpected behavior on debug builds.
2 parents 3f977ba + 702750c commit c2de81f

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)