fix: do not immediately drop lock
This commit is contained in:
parent
933a4cf851
commit
cc342852ed
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
loop {
|
loop {
|
||||||
let guard = act.last_activity.lock().unwrap();
|
let guard = act.last_activity.lock().unwrap();
|
||||||
let last = *guard;
|
let last = *guard;
|
||||||
let (_, result) = act
|
let (_unused, result) = act
|
||||||
.condvar
|
.condvar
|
||||||
.wait_timeout_while(guard, Duration::from_secs(args.timeout.into()), |instant| {
|
.wait_timeout_while(guard, Duration::from_secs(args.timeout.into()), |instant| {
|
||||||
*instant == last
|
*instant == last
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue