Use explicit wrapping_add to prevent potential unexpected behavior on debug builds
This commit is contained in:
parent
0bf018c588
commit
702750c538
@ -152,7 +152,7 @@ impl Barrier {
|
|||||||
BarrierWaitResult(false)
|
BarrierWaitResult(false)
|
||||||
} else {
|
} else {
|
||||||
lock.count = 0;
|
lock.count = 0;
|
||||||
lock.generation_id += 1;
|
lock.generation_id = lock.generation_id.wrapping_add(1);
|
||||||
self.cvar.notify_all();
|
self.cvar.notify_all();
|
||||||
BarrierWaitResult(true)
|
BarrierWaitResult(true)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user