提交 167bdff0 编写于 作者: B Brian Anderson

std::rt: Schedule more scheduler callbacks to avoid dropping messages

上级 d123df26
......@@ -339,8 +339,8 @@ fn interpret_message_queue(~self) -> Option<~Scheduler> {
let mut this = self;
match this.message_queue.pop() {
Some(PinnedTask(task)) => {
let mut task = task;
this.event_loop.callback(Scheduler::run_sched_once);
let mut task = task;
task.give_home(Sched(this.make_handle()));
this.resume_task_immediately(task);
return None;
......@@ -351,10 +351,12 @@ fn interpret_message_queue(~self) -> Option<~Scheduler> {
return this.sched_schedule_task(task);
}
Some(Wake) => {
this.event_loop.callback(Scheduler::run_sched_once);
this.sleepy = false;
return Some(this);
}
Some(Shutdown) => {
this.event_loop.callback(Scheduler::run_sched_once);
if this.sleepy {
// There may be an outstanding handle on the
// sleeper list. Pop them all to make sure that's
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册