about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2012-07-12 19:42:58 -0400
committerBen Blum <bblum@andrew.cmu.edu>2012-07-12 19:49:49 -0400
commit5724c6454950617c292daba89cdb9a3b4c862430 (patch)
tree12c612fa03bafbb757fb275b360c81bd0b0ad408 /src/rt
parent1c62f5ff74e8c6d434001d4571e5f28ae2705ed9 (diff)
downloadrust-5724c6454950617c292daba89cdb9a3b4c862430.tar.gz
rust-5724c6454950617c292daba89cdb9a3b4c862430.zip
Revert linked failure (killing runtime)
This reverts commit 200a2ded3245eb0a1ca7b265ce83adba16d75b97.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp5
-rw-r--r--src/rt/rust_sched_loop.cpp4
-rw-r--r--src/rt/rust_task.cpp12
-rw-r--r--src/rt/rust_task.h4
-rw-r--r--src/rt/rustrt.def.in1
5 files changed, 3 insertions, 23 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index f648ed8d78c..55f1f8bf17e 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -863,11 +863,6 @@ rust_task_kill_other(rust_task *task) { /* Used for linked failure */
     task->kill();
 }
 
-extern "C" void
-rust_task_kill_all(rust_task *task) {
-    task->fail_sched_loop();
-}
-
 extern "C" rust_cond_lock*
 rust_create_cond_lock() {
     return new rust_cond_lock();
diff --git a/src/rt/rust_sched_loop.cpp b/src/rt/rust_sched_loop.cpp
index 54ebccfe8c3..4aed9a5e061 100644
--- a/src/rt/rust_sched_loop.cpp
+++ b/src/rt/rust_sched_loop.cpp
@@ -260,8 +260,8 @@ rust_task *
 rust_sched_loop::create_task(rust_task *spawner, const char *name) {
     rust_task *task =
         new (this->kernel, "rust_task")
-        rust_task(this, task_state_newborn,
-                  spawner, name, kernel->env->min_stack_size);
+        rust_task (this, task_state_newborn,
+                   spawner, name, kernel->env->min_stack_size);
     DLOG(this, task, "created task: " PTR ", spawner: %s, name: %s",
                         task, spawner ? spawner->name : "null", name);
 
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index a6c9b791fda..3d88c05b3ff 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -129,11 +129,6 @@ cleanup_task(cleanup_args *args) {
         // assert(task->task_local_data != NULL);
         task->task_local_data_cleanup(task->task_local_data);
         task->task_local_data = NULL;
-    } else if (threw_exception) {
-        // Edge case: If main never spawns any tasks, but fails anyway, TLS
-        // won't be around to take down the kernel (task.rs:kill_taskgroup,
-        // rust_task_kill_all). Do it here instead.
-        task->fail_sched_loop();
     }
 
     // FIXME (#2676): For performance we should do the annihilator
@@ -287,7 +282,6 @@ rust_task::kill() {
     LOG(this, task, "preparing to unwind task: 0x%" PRIxPTR, this);
 }
 
-// TODO(bblum): Move this to rust_builtin.cpp (cleanup)
 extern "C" CDECL
 bool rust_task_is_unwinding(rust_task *rt) {
     return rt->unwinding;
@@ -321,12 +315,8 @@ rust_task::begin_failure(char const *expr, char const *file, size_t line) {
 #else
     die();
     // FIXME (#908): Need unwinding on windows. This will end up aborting
-    fail_sched_loop();
-#endif
-}
-
-void rust_task::fail_sched_loop() {
     sched_loop->fail();
+#endif
 }
 
 void
diff --git a/src/rt/rust_task.h b/src/rt/rust_task.h
index d562d151894..1d87a0ed56c 100644
--- a/src/rt/rust_task.h
+++ b/src/rt/rust_task.h
@@ -275,10 +275,6 @@ public:
     void fail();
     void fail(char const *expr, char const *file, size_t line);
 
-    // Propagate failure to the entire rust runtime.
-    // TODO(bblum): maybe this can be done at rust-level?
-    void fail_sched_loop();
-
     // Disconnect from our supervisor.
     void unsupervise();
 
diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in
index a8256bba300..300d6bc79e8 100644
--- a/src/rt/rustrt.def.in
+++ b/src/rt/rustrt.def.in
@@ -178,7 +178,6 @@ rust_port_task
 rust_task_inhibit_kill
 rust_task_allow_kill
 rust_task_kill_other
-rust_task_kill_all
 rust_create_cond_lock
 rust_destroy_cond_lock
 rust_lock_cond_lock