diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-07-14 19:39:53 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-07-15 10:07:29 -0700 |
| commit | ced8393f203fc661df7a5a0159a5edfd826eef12 (patch) | |
| tree | efc98dacc8ec300c63b2e3af1c7dd78f7f4bac5a /src/rt/rust_builtin.cpp | |
| parent | d9cc4cb81b91e5d1735ef6c14e181e41247c9314 (diff) | |
| download | rust-ced8393f203fc661df7a5a0159a5edfd826eef12.tar.gz rust-ced8393f203fc661df7a5a0159a5edfd826eef12.zip | |
Modify task::join to indicate how the task terminated
This involves sticking yet another field into the task structure
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 e8900dd730a..bdabbb1ed37 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -410,7 +410,7 @@ task_yield(rust_task *task) { task->yield(1); } -extern "C" CDECL void +extern "C" CDECL intptr_t task_join(rust_task *task, rust_task *join_task) { // If the other task is already dying, we don't have to wait for it. join_task->lock.lock(); @@ -423,6 +423,11 @@ task_join(rust_task *task, rust_task *join_task) { else { join_task->lock.unlock(); } + if (!join_task->failed) { + return 0; + } else { + return -1; + } } extern "C" CDECL void |
