about summary refs log tree commit diff
path: root/src/libcore/task/spawn.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-05-20 21:40:27 -0700
committerbors <bors@rust-lang.org>2013-05-20 21:40:27 -0700
commit7abcc142e5da1b87c59a1510fa87aefc4122bd6d (patch)
treee069fcc7e3da94e50e678fcc723eb59b87123b3c /src/libcore/task/spawn.rs
parentadaae45c3e15f95b052648f3511a1097155296b9 (diff)
parenta246e8faf362a1615b5bb4938455dd70642e0f4b (diff)
downloadrust-7abcc142e5da1b87c59a1510fa87aefc4122bd6d.tar.gz
rust-7abcc142e5da1b87c59a1510fa87aefc4122bd6d.zip
auto merge of #6626 : brson/rust/io-upstream, r=graydon
r?

Mostly refactoring, and adding some of the remaining types described in #4419.

The [`Local`](https://github.com/brson/rust/blob/3b4ff41511cfaa5e311b03d16b47bf40c117fa2f/src/libcore/rt/local.rs#L17) trait collects some common, often unsafe patterns around task-local and thread-local values. Making all these types safe is largely the aim of #6210.



Diffstat (limited to 'src/libcore/task/spawn.rs')
-rw-r--r--src/libcore/task/spawn.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
index 8d287b5c51f..81e5af5caab 100644
--- a/src/libcore/task/spawn.rs
+++ b/src/libcore/task/spawn.rs
@@ -90,6 +90,7 @@ use task::unkillable;
 use uint;
 use util;
 use unstable::sync::{Exclusive, exclusive};
+use rt::local::Local;
 
 #[cfg(test)] use task::default_task_opts;
 
@@ -575,7 +576,7 @@ pub fn spawn_raw(opts: TaskOpts, f: ~fn()) {
 fn spawn_raw_newsched(_opts: TaskOpts, f: ~fn()) {
     use rt::sched::*;
 
-    let mut sched = local_sched::take();
+    let mut sched = Local::take::<Scheduler>();
     let task = ~Coroutine::new(&mut sched.stack_pool, f);
     sched.schedule_new_task(task);
 }