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.cpp5
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);