From c4f9bd94700188678893659580f3b7aa80da3b7d Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Mon, 13 Jun 2011 18:19:08 -0700 Subject: Re-enabled join. --- src/rt/rust_builtin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_builtin.cpp') 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. */ -- cgit 1.4.1-3-g733a5