Use explicit wrapping_add to prevent potential unexpected behavior on debug builds

This commit is contained in:
Stefan Schindler 2017-08-01 16:25:36 +02:00
parent 0bf018c588
commit 702750c538
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}