diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-06-13 18:19:08 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-06-15 18:16:59 -0700 |
| commit | c4f9bd94700188678893659580f3b7aa80da3b7d (patch) | |
| tree | 0d96a277405d57f1b8ddd52b5fbcbff6fd281be3 /src/rt/rust_builtin.cpp | |
| parent | 1fa9133b76ec4641e5470cbea8a8f95ec32f9563 (diff) | |
| download | rust-c4f9bd94700188678893659580f3b7aa80da3b7d.tar.gz rust-c4f9bd94700188678893659580f3b7aa80da3b7d.zip | |
Re-enabled join.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 7 |
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. */ |
