about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp37
1 files changed, 10 insertions, 27 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index e0494c9300b..6b7a8241416 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -291,13 +291,21 @@ rust_kernel::set_exit_status(int code) {
 }
 
 void
-rust_kernel::register_task() {
-    KLOG_("Registering task");
+rust_kernel::inc_live_count() {
     uintptr_t new_non_weak_tasks = sync::increment(non_weak_tasks);
     KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
 }
 
 void
+rust_kernel::dec_live_count() {
+    uintptr_t new_non_weak_tasks = sync::decrement(non_weak_tasks);
+    KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
+    if (new_non_weak_tasks == 0) {
+        begin_shutdown();
+    }
+}
+
+void
 rust_kernel::allow_scheduler_exit() {
     scoped_lock with(sched_lock);
 
@@ -316,31 +324,6 @@ rust_kernel::allow_scheduler_exit() {
 }
 
 void
-rust_kernel::unregister_task() {
-    KLOG_("Unregistering task");
-    uintptr_t new_non_weak_tasks = sync::decrement(non_weak_tasks);
-    KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
-    if (new_non_weak_tasks == 0) {
-        begin_shutdown();
-    }
-}
-
-void
-rust_kernel::inc_weak_task_count() {
-    uintptr_t new_non_weak_tasks = sync::decrement(non_weak_tasks);
-    KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
-    if (new_non_weak_tasks == 0) {
-        begin_shutdown();
-    }
-}
-
-void
-rust_kernel::dec_weak_task_count() {
-    uintptr_t new_non_weak_tasks = sync::increment(non_weak_tasks);
-    KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
-}
-
-void
 rust_kernel::begin_shutdown() {
     {
         scoped_lock with(sched_lock);