about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-07-02 17:42:58 -0700
committerEric Holk <eric.holk@gmail.com>2012-07-06 10:42:39 -0700
commite5c9cb2b3df91df4207d63611a1918e461219456 (patch)
tree2b01aa2534ed3bbfe645093e83b3ac2586acf337 /src/rt/rust_builtin.cpp
parenta4838c93aadf4dbc32e71ddff19c6ecb6a95a66d (diff)
downloadrust-e5c9cb2b3df91df4207d63611a1918e461219456.tar.gz
rust-e5c9cb2b3df91df4207d63611a1918e461219456.zip
Pipes sleep and wake properly.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index a33d3cb90fe..732dbaa3293 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -922,6 +922,26 @@ rust_task_local_data_atexit(rust_task *task, void (*cleanup_fn)(void *data)) {
     task->task_local_data_cleanup = cleanup_fn;
 }
 
+extern "C" void
+task_clear_event_reject(rust_task *task) {
+    task->clear_event_reject();
+}
+
+// Waits on an event, returning the pointer to the event that unblocked this
+// task.
+extern "C" void *
+task_wait_event(rust_task *task) {
+    // TODO: we should assert that the passed in task is the currently running
+    // task. We wouldn't want to wait some other task.
+
+    return task->wait_event();
+}
+
+extern "C" void
+task_signal_event(rust_task *target, void *event) {
+    target->signal_event(event);
+}
+
 //
 // Local Variables:
 // mode: C++