fix: avoid lock for probe_network, avoiding deadlock on startup

Closes #1532
This commit is contained in:
dignifiedquire
2020-05-27 15:13:29 +02:00
parent 9f7f387540
commit 6100a23e80
6 changed files with 205 additions and 166 deletions

View File

@@ -140,8 +140,10 @@ impl Context {
info!(self, "starting IO");
assert!(!self.is_io_running().await, "context is already running");
let l = &mut *self.inner.scheduler.write().await;
l.start(self.clone()).await;
{
let l = &mut *self.inner.scheduler.write().await;
l.start(self.clone()).await;
}
}
/// Returns if the IO scheduler is running.