Don't notify task if ready
This commit is contained in:
1 parent
493b0693c5
commit
ed2ce6e039
1 file changed
+6
-5
@@ -49,14 +49,15 @@ impl Scheduler {
|
||||
};
|
||||
|
||||
let mut cx = std::task::Context::from_waker(&task.waker);
|
||||
let _ = task.task.borrow_mut().as_mut().poll(&mut cx);
|
||||
|
||||
if !task.task.borrow_mut().as_mut().poll(&mut cx).is_ready() {
|
||||
self.sender
|
||||
.unbounded_send(SchedulerMsg::TaskNotified(task_id))
|
||||
.expect("Scheduler should exist");
|
||||
}
|
||||
|
||||
entry.insert(task);
|
||||
|
||||
self.sender
|
||||
.unbounded_send(SchedulerMsg::TaskNotified(task_id))
|
||||
.expect("Scheduler should exist");
|
||||
|
||||
task_id
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user