Skip to content

Commit

Permalink
fix inadvertently dropping MutexGuard in TickerControl
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-laplante committed Feb 6, 2024
1 parent e3b1b66 commit 44618a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl TickerControl {
drop(arc); // Also need to drop Arc otherwise BarState won't be dropped

// Wait for `interval` but return early if we are notified to stop
let (_, result) = self
let result = self
.stopping
.1
.wait_timeout_while(self.stopping.0.lock().unwrap(), interval, |stopped| {
Expand All @@ -696,7 +696,7 @@ impl TickerControl {
.unwrap();

// If the wait didn't time out, it means we were notified to stop
if !result.timed_out() {
if !result.1.timed_out() {
break;
}
}
Expand Down

0 comments on commit 44618a8

Please sign in to comment.