diff options
| author | bors <bors@rust-lang.org> | 2013-02-12 14:36:33 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-02-12 14:36:33 -0800 |
| commit | bc2d147847f2c8190250ddb25e3bc71b38cfaf0a (patch) | |
| tree | 58ac04240d689afa51da396928a0a2583769f8a8 /src/rt/rust_kernel.cpp | |
| parent | 21a0d52a85895434ec1ac2f2293b89112bfc0002 (diff) | |
| parent | 0db527e2f8033e49ee588b3be71f3cd7a0d13b7c (diff) | |
| download | rust-bc2d147847f2c8190250ddb25e3bc71b38cfaf0a.tar.gz rust-bc2d147847f2c8190250ddb25e3bc71b38cfaf0a.zip | |
auto merge of #4858 : z0w0/rust/rm_weak_task_count, r=graydon
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); |
