about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-07-17 20:40:40 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-07-17 20:45:07 -0400
commit4cf6b4d3b4ea5cd231ab96d82f5f8cd794e0b2c3 (patch)
tree3f9ca49a7c78422148869b50df72f999c706cbe2 /src/rt/rust_task.cpp
parentd930d717e5f4557e47c9fd5bdca62a92f5cc8c38 (diff)
downloadrust-4cf6b4d3b4ea5cd231ab96d82f5f8cd794e0b2c3.tar.gz
rust-4cf6b4d3b4ea5cd231ab96d82f5f8cd794e0b2c3.zip
Tasks should not hold a ref to their parent (Close #1789)
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 64ee56a5115..84984d499e9 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -10,12 +10,9 @@
 #include "rust_env.h"
 #include "rust_port.h"
 
-// FIXME (#1789) (bblum): get rid of supervisors
-
 // Tasks
 rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state,
-                     rust_task *spawner, const char *name,
-                     size_t init_stack_sz) :
+                     const char *name, size_t init_stack_sz) :
     ref_count(1),
     id(0),
     notify_enabled(false),
@@ -30,7 +27,6 @@ rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state,
     local_region(&sched_loop->local_region),
     boxed(sched_loop->kernel->env, &local_region),
     unwinding(false),
-    propagate_failure(true),
     cc_counter(0),
     total_stack_sz(0),
     task_local_data(NULL),
@@ -45,17 +41,13 @@ rust_task::rust_task(rust_sched_loop *sched_loop, rust_task_state state,
     disallow_kill(0),
     c_stack(NULL),
     next_c_sp(0),
-    next_rust_sp(0),
-    supervisor(spawner)
+    next_rust_sp(0)
 {
     LOGPTR(sched_loop, "new task", (uintptr_t)this);
     DLOG(sched_loop, task, "sizeof(task) = %d (0x%x)",
          sizeof *this, sizeof *this);
 
     new_stack(init_stack_sz);
-    if (supervisor) {
-        supervisor->ref();
-    }
 }
 
 // NB: This does not always run on the task's scheduler thread
@@ -65,15 +57,6 @@ rust_task::delete_this()
     DLOG(sched_loop, task, "~rust_task %s @0x%" PRIxPTR ", refcnt=%d",
          name, (uintptr_t)this, ref_count);
 
-    // FIXME (#2677): We should do this when the task exits, not in the
-    // destructor
-    {
-        scoped_lock with(supervisor_lock);
-        if (supervisor) {
-            supervisor->deref();
-        }
-    }
-
     /* FIXME (#2677): tighten this up, there are some more
        assertions that hold at task-lifecycle events. */
     assert(ref_count == 0); // ||
@@ -335,21 +318,6 @@ void rust_task::fail_sched_loop() {
     sched_loop->fail();
 }
 
-void
-rust_task::unsupervise()
-{
-    scoped_lock with(supervisor_lock);
-    if (supervisor) {
-        DLOG(sched_loop, task,
-             "task %s @0x%" PRIxPTR
-             " disconnecting from supervisor %s @0x%" PRIxPTR,
-             name, this, supervisor->name, supervisor);
-        supervisor->deref();
-    }
-    supervisor = NULL;
-    propagate_failure = false;
-}
-
 frame_glue_fns*
 rust_task::get_frame_glue_fns(uintptr_t fp) {
     fp -= sizeof(uintptr_t);