about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-02-08 16:22:38 -0800
committerBrian Anderson <banderson@mozilla.com>2012-02-09 19:00:15 -0800
commitd756b01619444bbbaa27d1f43ca4000c976c8bee (patch)
treebb6149a6f7da26918a149880fdfab78bf7530bd7 /src/rt/rust_builtin.cpp
parente0d5b92b84424b5b1dbd2dec7d32e92e1550832b (diff)
downloadrust-d756b01619444bbbaa27d1f43ca4000c976c8bee.tar.gz
rust-d756b01619444bbbaa27d1f43ca4000c976c8bee.zip
rt: Add a function for configuring task notification
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 65e5b82f505..fb00b07bdfd 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -481,6 +481,16 @@ drop_task(rust_task *target) {
     }
 }
 
+extern "C" CDECL void
+rust_task_config_notify(rust_task_id task_id, chan_handle *chan) {
+    rust_task *task = rust_task_thread::get_task();
+    rust_task *target = task->kernel->get_task_by_id(task_id);
+    A(task->thread, target != NULL,
+      "This function should only be called when we know the task exists");
+    target->config_notify(*chan);
+    target->deref();
+}
+
 extern "C" CDECL rust_task *
 get_task_pointer(rust_task_id id) {
     rust_task *task = rust_task_thread::get_task();