about summary refs log tree commit diff
path: root/src/rt/rust_task_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task_thread.cpp')
-rw-r--r--src/rt/rust_task_thread.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rt/rust_task_thread.cpp b/src/rt/rust_task_thread.cpp
index a167c63cfe2..fd7c10ef676 100644
--- a/src/rt/rust_task_thread.cpp
+++ b/src/rt/rust_task_thread.cpp
@@ -146,8 +146,6 @@ rust_task_thread::reap_dead_tasks() {
     // from the scheduler, which may end up trying to take this lock
     lock.unlock();
 
-    // Release the task from the kernel so nobody else can get at it
-    kernel->release_task_id(dead_task->id);
     dead_task->delete_all_stacks();
     // Deref the task, which may cause it to request us to release it
     dead_task->deref();
@@ -316,7 +314,7 @@ rust_task_thread::create_task(rust_task *spawner, const char *name,
         newborn_tasks.append(task);
     }
 
-    kernel->register_task(task);
+    task->id = kernel->generate_task_id();
     return task;
 }