diff options
| author | unknown <Eric@.(none)> | 2011-08-08 13:38:20 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-08 16:55:38 -0700 |
| commit | 44bef5f2cb175769155d92ec65bd6b16e6708a1e (patch) | |
| tree | d7524b51e2af0cb191cd93cda3f282ac4ac8f4c6 /src/rt/rust_builtin.cpp | |
| parent | f4f057ced1f4152575571a6e5116e1ad5bb38beb (diff) | |
| download | rust-44bef5f2cb175769155d92ec65bd6b16e6708a1e.tar.gz rust-44bef5f2cb175769155d92ec65bd6b16e6708a1e.zip | |
Introduced task handles.
This is the new way to refer to tasks in rust-land. Currently all they do is serve as a key to look up the old rust_task structure. Ideally they won't be ref counted, but baby steps.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 862373e07dd..7653bc35ee2 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -408,8 +408,11 @@ task_yield(rust_task *task) { } extern "C" CDECL intptr_t -task_join(rust_task *task, rust_task *join_task) { +task_join(rust_task *task, rust_task_id tid) { // If the other task is already dying, we don't have to wait for it. + rust_task *join_task = task->kernel->get_task_by_id(tid); + // FIXME: find task exit status and return that. + if(!join_task) return 0; join_task->lock.lock(); if (join_task->dead() == false) { join_task->tasks_waiting_to_join.push(task); |
