diff options
| author | Zack Corr <zack@z0w0.me> | 2013-02-09 19:19:31 +1000 |
|---|---|---|
| committer | Zack Corr <zack@z0w0.me> | 2013-02-09 19:19:31 +1000 |
| commit | ebd20b7944c3b427a90e89d3b4a9e43926336eb8 (patch) | |
| tree | f09f4e4139ff0a5b6199e6bd6c9a77970c4fc7d5 /src/rt/rust_kernel.cpp | |
| parent | 0c2b4edff5009ff4d2330723d9acbc85af4b12ab (diff) | |
| download | rust-ebd20b7944c3b427a90e89d3b4a9e43926336eb8.tar.gz rust-ebd20b7944c3b427a90e89d3b4a9e43926336eb8.zip | |
Rename dec/inc_weak_task_count to inc/dec_live_count and remove register_task/unregister_task. Closes #4768
Diffstat (limited to 'src/rt/rust_kernel.cpp')
| -rw-r--r-- | src/rt/rust_kernel.cpp | 37 |
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); |
