From cc9ab2c0339aa00566ee6c5d12383278c7bd7eef Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 21 Jan 2013 19:22:55 -0800 Subject: Remove old comm-based weak task interface --- src/rt/rust_kernel.cpp | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'src/rt/rust_kernel.cpp') diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp index 8ca49ea6a57..c365f3cca1e 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -368,30 +368,6 @@ rust_kernel::unregister_task() { } } -void -rust_kernel::weaken_task(rust_port_id chan) { - { - scoped_lock with(weak_task_lock); - KLOG_("Weakening task with channel %" PRIdPTR, chan); - weak_task_chans.push_back(chan); - } - inc_weak_task_count(); -} - -void -rust_kernel::unweaken_task(rust_port_id chan) { - dec_weak_task_count(); - { - scoped_lock with(weak_task_lock); - KLOG_("Unweakening task with channel %" PRIdPTR, chan); - std::vector::iterator iter = - std::find(weak_task_chans.begin(), weak_task_chans.end(), chan); - if (iter != weak_task_chans.end()) { - weak_task_chans.erase(iter); - } - } -} - void rust_kernel::inc_weak_task_count() { uintptr_t new_non_weak_tasks = sync::decrement(non_weak_tasks); @@ -407,23 +383,6 @@ rust_kernel::dec_weak_task_count() { KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks); } -void -rust_kernel::end_weak_tasks() { - std::vector chancopies; - { - scoped_lock with(weak_task_lock); - chancopies = weak_task_chans; - weak_task_chans.clear(); - } - while (!chancopies.empty()) { - rust_port_id chan = chancopies.back(); - chancopies.pop_back(); - KLOG_("Notifying weak task " PRIdPTR, chan); - uintptr_t token = 0; - send_to_port(chan, &token); - } -} - void rust_kernel::begin_shutdown() { { @@ -439,7 +398,6 @@ rust_kernel::begin_shutdown() { run_exit_functions(); allow_scheduler_exit(); - end_weak_tasks(); } bool -- cgit 1.4.1-3-g733a5