about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-06-16 02:03:37 -0700
committerBrian Anderson <banderson@mozilla.com>2013-06-16 15:09:25 -0700
commit319cf6e465f203c794d71800808c2bd60a1e7613 (patch)
treefd5b6d143357eedbdef914976e14bf3fd9474516 /src/libstd/task
parentb9119edc55287bb1a9b5609bdef84001c3341e22 (diff)
parent3208fc36bf2c7e99451e21171f82dafef2ea51dc (diff)
downloadrust-319cf6e465f203c794d71800808c2bd60a1e7613.tar.gz
rust-319cf6e465f203c794d71800808c2bd60a1e7613.zip
Merge remote-tracking branch 'brson/io'
Conflicts:
	src/libstd/rt/comm.rs
	src/libstd/rt/mod.rs
	src/libstd/rt/sched.rs
	src/libstd/rt/task.rs
	src/libstd/rt/test.rs
	src/libstd/rt/tube.rs
	src/libstd/rt/uv/uvio.rs
	src/libstd/rt/uvio.rs
	src/libstd/task/spawn.rs
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs15
-rw-r--r--src/libstd/task/spawn.rs10
2 files changed, 10 insertions, 15 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs
index 223afbce091..99858feab22 100644
--- a/src/libstd/task/mod.rs
+++ b/src/libstd/task/mod.rs
@@ -520,20 +520,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 30ad4ee2a89..9df93d19d21 100644
--- a/src/libstd/task/spawn.rs
+++ b/src/libstd/task/spawn.rs
@@ -93,6 +93,7 @@ use util;
 use unstable::sync::{Exclusive, exclusive};
 use rt::local::Local;
 use iterator::{IteratorUtil};
+use rt::task::Task;
 
 #[cfg(test)] use task::default_task_opts;
 #[cfg(test)] use comm;
@@ -585,9 +586,14 @@ 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);
-    sched.schedule_new_task(task);
+    let task = ~Coroutine::with_task(&mut sched.stack_pool,
+                                     task, f);
+    sched.schedule_task(task);
 }
 
 fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {