about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 6c7ab554002..70afcdd9d58 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -118,12 +118,15 @@ void task_start_wrapper(spawn_args *a)
     a->f(&rval, task, a->a3, a->a4);
 
     LOG(task, task, "task exited with value %d", rval);
+    
 
     LOG(task, task, "task ref_count: %d", task->ref_count);
     A(task->sched, task->ref_count >= 0,
       "Task ref_count should not be negative on exit!");
     task->die();
+    task->lock.lock();
     task->notify_tasks_waiting_to_join();
+    task->lock.unlock();
 
     task->yield(1);
 }