Fix scope of lock
@@ -172,12 +172,14 @@ pub fn spawn_thread_alive_checker() {
let max_time_since_death =
ThreadDeadIgnoreDelay::configured_value().into();
loop {
+ {
let statuses =
&mut THREAD_STATUSES.lock()
.expect("THREAD_STATUSES poisoned");
check_thread_heartbeats(statuses, threshold);
log_dead_threads(statuses);
cull_dead_threads(statuses, max_time_since_death);
+ }
thread::sleep(delay);
}
})
