about summary refs log tree commit diff
path: root/src/rt/rust_scheduler.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-07-06 11:10:40 -0700
committerEric Holk <eholk@mozilla.com>2011-07-06 11:30:00 -0700
commitbc5d6aefdabc2ee928cb0599c5a8c73799f191ef (patch)
tree807d489bf1280b0b9c6b4ccbc4a5dc3e186513ed /src/rt/rust_scheduler.cpp
parentbbdba21b1f3c7dfc4c0bac3525cc35939ae8ca4c (diff)
downloadrust-bc5d6aefdabc2ee928cb0599c5a8c73799f191ef.tar.gz
rust-bc5d6aefdabc2ee928cb0599c5a8c73799f191ef.zip
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.
Diffstat (limited to 'src/rt/rust_scheduler.cpp')
-rw-r--r--src/rt/rust_scheduler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/rust_scheduler.cpp b/src/rt/rust_scheduler.cpp
index 0318d9801f1..00368205de7 100644
--- a/src/rt/rust_scheduler.cpp
+++ b/src/rt/rust_scheduler.cpp
@@ -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;
 }