From ebd20b7944c3b427a90e89d3b4a9e43926336eb8 Mon Sep 17 00:00:00 2001 From: Zack Corr Date: Sat, 9 Feb 2013 19:19:31 +1000 Subject: Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768 --- src/rt/rust_kernel.cpp | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) (limited to 'src/rt/rust_kernel.cpp') 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,12 +291,20 @@ 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); @@ -315,31 +323,6 @@ rust_kernel::allow_scheduler_exit() { osmain_sched->allow_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() { { -- cgit 1.4.1-3-g733a5