Skip to content

Instantly share code, notes, and snippets.

@bblum
Created July 22, 2013 20:43
Show Gist options
  • Save bblum/6057504 to your computer and use it in GitHub Desktop.
Save bblum/6057504 to your computer and use it in GitHub Desktop.
fn deschedule_running_task_and_then_inner(~self, fn(&mut Scheduler, Task)); // does not BlockedTask::try_block() the task
fn deschedule_running_task_and_then(~self, user_blk: fn(&mut Scheduler, BlockedTask) {
do self.deschedule_running_task_and_then_inner |sched, task| {
// remove this logic from fn run_cleanup_job() now that it will be here
match BlockedTask::try_block(task) {
Left(killed_task) => sched.enqueue_task(killed_task),
Right(blocked_task) => user_blk(sched, blocked_task),
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment