avoid race condition on scheduler start

This commit is contained in:
dignifiedquire
2020-03-18 16:34:18 +01:00
parent 9d313b4e0e
commit 9981e84a42
2 changed files with 11 additions and 12 deletions

View File

@@ -132,8 +132,8 @@ impl Context {
panic!("Already running");
}
let scheduler = Scheduler::run(self.clone());
*self.inner.scheduler.write().await = scheduler;
let l = &mut *self.inner.scheduler.write().await;
l.run(self.clone());
}
pub async fn stop(&self) {