Skip to content

Commit

Permalink
Use saturating_add for WaitWhileResult
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhitc committed May 29, 2022
1 parent 686db47 commit 0458283
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/condvar.rs
Expand Up @@ -411,7 +411,7 @@ impl Condvar {
let mut timeout_result = WaitTimeoutResult(false);

while !timeout_result.timed_out() && condition(mutex_guard.deref_mut()) {
result.0 += 1;
result.0 = result.0.saturating_add(1);
timeout_result =
self.wait_until_internal(unsafe { MutexGuard::mutex(mutex_guard).raw() }, timeout);
}
Expand Down

0 comments on commit 0458283

Please sign in to comment.