Added a task wakeup callback. Closes #599.

The callback happens when a task moves from the "blocked" state to the
"running" state. The callback is also inherited by child tasks. There
is currently only a native API.

This code hasn't been heavily exercised yet.
This commit is contained in:
Eric Holk
2011-07-06 11:10:40 -07:00
parent bbdba21b1f
commit bc5d6aefda
3 changed files with 22 additions and 2 deletions

View File

@@ -291,8 +291,10 @@ rust_scheduler::create_task(rust_task *spawner, const char *name) {
new (this->kernel) rust_task (this, &newborn_tasks, spawner, name);
DLOG(this, task, "created task: " PTR ", spawner: %s, name: %s",
task, spawner ? spawner->name : "null", name);
if(spawner)
if(spawner) {
task->pin(spawner->pinned_on);
task->on_wakeup(spawner->_on_wakeup);
}
newborn_tasks.append(task);
return task;
}