summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-06-13 18:19:08 -0700
committerEric Holk <eholk@mozilla.com>2011-06-15 18:16:59 -0700
commitc4f9bd94700188678893659580f3b7aa80da3b7d (patch)
tree0d96a277405d57f1b8ddd52b5fbcbff6fd281be3 /src/rt/rust_builtin.cpp
parent1fa9133b76ec4641e5470cbea8a8f95ec32f9563 (diff)
downloadrust-c4f9bd94700188678893659580f3b7aa80da3b7d.tar.gz
rust-c4f9bd94700188678893659580f3b7aa80da3b7d.zip
Re-enabled join.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 65c9d7e76a1..3500743a79e 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -361,7 +361,12 @@ task_yield(rust_task *task) {
 
 extern "C" CDECL void
 task_join(rust_task *task, rust_task *join_task) {
-    // TODO
+    // If the other task is already dying, we don't have to wait for it.
+    if (join_task->dead() == false) {
+        join_task->tasks_waiting_to_join.push(task);
+        task->block(join_task, "joining local task");
+        task->yield(2);
+    }
 }
 
 /* Debug builtins for std.dbg. */