about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs15
-rw-r--r--src/libstd/task/spawn.rs8
2 files changed, 9 insertions, 14 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs
index df5b88207ec..dbfb9baefa7 100644
--- a/src/libstd/task/mod.rs
+++ b/src/libstd/task/mod.rs
@@ -513,20 +513,9 @@ pub fn failing() -> bool {
             }
         }
         _ => {
-            let mut unwinding = false;
-            do Local::borrow::<Task, ()> |local| {
-                unwinding = match local.unwinder {
-                    Some(unwinder) => {
-                        unwinder.unwinding
-                    }
-                    None => {
-                        // Because there is no unwinder we can't be unwinding.
-                        // (The process will abort on failure)
-                        false
-                    }
-                }
+            do Local::borrow::<Task, bool> |local| {
+                local.unwinder.unwinding
             }
-            return unwinding;
         }
     }
 }
diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs
index 5e507238f67..bff4aa1498d 100644
--- a/src/libstd/task/spawn.rs
+++ b/src/libstd/task/spawn.rs
@@ -91,6 +91,7 @@ use uint;
 use util;
 use unstable::sync::{Exclusive, exclusive};
 use rt::local::Local;
+use rt::task::Task;
 
 #[cfg(test)] use task::default_task_opts;
 
@@ -576,8 +577,13 @@ pub fn spawn_raw(opts: TaskOpts, f: ~fn()) {
 fn spawn_raw_newsched(_opts: TaskOpts, f: ~fn()) {
     use rt::sched::*;
 
+    let task = do Local::borrow::<Task, ~Task>() |running_task| {
+        ~running_task.new_child()
+    };
+
     let mut sched = Local::take::<Scheduler>();
-    let task = ~Coroutine::new(&mut sched.stack_pool, f);
+    let task = ~Coroutine::with_task(&mut sched.stack_pool,
+                                     task, f);
     sched.schedule_task(task);
 }