about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-01-21 19:22:55 -0800
committerBrian Anderson <banderson@mozilla.com>2013-01-23 17:35:34 -0800
commitcc9ab2c0339aa00566ee6c5d12383278c7bd7eef (patch)
treef45ae66e7ce00c66cae3c793d088250a4af8003b /src/rt
parenta3e087cefacb1b92476543fe7d6ef68f0ca82dd8 (diff)
Remove old comm-based weak task interface
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp12
-rw-r--r--src/rt/rust_kernel.cpp42
-rw-r--r--src/rt/rust_kernel.h7
-rw-r--r--src/rt/rustrt.def.in2
4 files changed, 0 insertions, 63 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 327337f441d..4fcfc11b325 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -858,18 +858,6 @@ rust_compare_and_swap_ptr(intptr_t *address,
     return sync::compare_and_swap(address, oldval, newval);
 }
 
-extern "C" CDECL void
-rust_task_weaken(rust_port_id chan) {
-    rust_task *task = rust_get_current_task();
-    task->kernel->weaken_task(chan);
-}
-
-extern "C" CDECL void
-rust_task_unweaken(rust_port_id chan) {
-    rust_task *task = rust_get_current_task();
-    task->kernel->unweaken_task(chan);
-}
-
 extern "C" void
 rust_task_inhibit_kill(rust_task *task) {
     task->inhibit_kill();
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
@@ -369,30 +369,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<rust_port_id>::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);
     KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
@@ -408,23 +384,6 @@ rust_kernel::dec_weak_task_count() {
 }
 
 void
-rust_kernel::end_weak_tasks() {
-    std::vector<rust_port_id> 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() {
     {
         scoped_lock with(sched_lock);
@@ -439,7 +398,6 @@ rust_kernel::begin_shutdown() {
 
     run_exit_functions();
     allow_scheduler_exit();
-    end_weak_tasks();
 }
 
 bool
diff --git a/src/rt/rust_kernel.h b/src/rt/rust_kernel.h
index 8ba0405b86e..c25cef9fef9 100644
--- a/src/rt/rust_kernel.h
+++ b/src/rt/rust_kernel.h
@@ -119,14 +119,9 @@ class rust_kernel {
 
     // An atomically updated count of the live, 'non-weak' tasks
     uintptr_t non_weak_tasks;
-    // Protects weak_task_chans
-    lock_and_signal weak_task_lock;
-    // A list of weak tasks that need to be told when to exit
-    std::vector<rust_port_id> weak_task_chans;
 
     rust_scheduler* get_scheduler_by_id_nolock(rust_sched_id id);
     void allow_scheduler_exit();
-    void end_weak_tasks();
     void begin_shutdown();
 
     lock_and_signal at_exit_lock;
@@ -180,8 +175,6 @@ public:
 
     void register_task();
     void unregister_task();
-    void weaken_task(rust_port_id chan);
-    void unweaken_task(rust_port_id chan);
     void inc_weak_task_count();
     void dec_weak_task_count();
 
diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in
index 8e8ce9ee509..eb9db6c1d57 100644
--- a/src/rt/rustrt.def.in
+++ b/src/rt/rustrt.def.in
@@ -61,8 +61,6 @@ rust_task_yield
 rust_task_is_unwinding
 rust_get_task
 rust_get_stack_segment
-rust_task_weaken
-rust_task_unweaken
 rust_log_str
 start_task
 vec_reserve_shared_actual