about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
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 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