diff options
| author | bors <bors@rust-lang.org> | 2013-08-27 19:35:44 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-27 19:35:44 -0700 |
| commit | 578e68047736167239c52fa1aba0347011ff1bc3 (patch) | |
| tree | 00dfacbcaf5bcc846757d37cbf7e9309df699cb8 /src/libstd/task | |
| parent | 32117132bdaf572bd4a156ec931579646e16d6f0 (diff) | |
| parent | aac9d6eee9a1e0b254bf6e035e2e14e5106758bd (diff) | |
| download | rust-578e68047736167239c52fa1aba0347011ff1bc3.tar.gz rust-578e68047736167239c52fa1aba0347011ff1bc3.zip | |
auto merge of #8802 : pcwalton/rust/compile-speed, r=brson
r? @brson
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/local_data_priv.rs | 2 | ||||
| -rw-r--r-- | src/libstd/task/mod.rs | 12 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 10 |
3 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/task/local_data_priv.rs b/src/libstd/task/local_data_priv.rs index 8132bfe5377..2c2dfd8f689 100644 --- a/src/libstd/task/local_data_priv.rs +++ b/src/libstd/task/local_data_priv.rs @@ -28,7 +28,7 @@ impl Handle { pub fn new() -> Handle { use rt::local::Local; unsafe { - let task = Local::unsafe_borrow::<Task>(); + let task: *mut Task = Local::unsafe_borrow(); NewHandle(&mut (*task).storage) } } diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index f872c2614b9..c0b331c52ee 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -526,7 +526,7 @@ pub fn with_task_name<U>(blk: &fn(Option<&str>) -> U) -> U { use rt::task::Task; if in_green_task_context() { - do Local::borrow::<Task, U> |task| { + do Local::borrow |task: &mut Task| { match task.name { Some(ref name) => blk(Some(name.as_slice())), None => blk(None) @@ -545,7 +545,7 @@ pub fn deschedule() { // FIXME #6842: What does yield really mean in newsched? // FIXME(#7544): Optimize this, since we know we won't block. - let sched = Local::take::<Scheduler>(); + let sched: ~Scheduler = Local::take(); do sched.deschedule_running_task_and_then |sched, task| { sched.enqueue_blocked_task(task); } @@ -556,7 +556,7 @@ pub fn failing() -> bool { use rt::task::Task; - do Local::borrow::<Task, bool> |local| { + do Local::borrow |local: &mut Task| { local.unwinder.unwinding } } @@ -582,7 +582,7 @@ pub fn unkillable<U>(f: &fn() -> U) -> U { unsafe { if in_green_task_context() { // The inhibits/allows might fail and need to borrow the task. - let t = Local::unsafe_borrow::<Task>(); + let t: *mut Task = Local::unsafe_borrow(); do (|| { (*t).death.inhibit_kill((*t).unwinder.unwinding); f() @@ -616,7 +616,7 @@ pub fn rekillable<U>(f: &fn() -> U) -> U { unsafe { if in_green_task_context() { - let t = Local::unsafe_borrow::<Task>(); + let t: *mut Task = Local::unsafe_borrow(); do (|| { (*t).death.allow_kill((*t).unwinder.unwinding); f() @@ -1032,7 +1032,7 @@ fn test_try_fail() { #[cfg(test)] fn get_sched_id() -> int { - do Local::borrow::<::rt::sched::Scheduler, int> |sched| { + do Local::borrow |sched: &mut ::rt::sched::Scheduler| { sched.sched_id() as int } } diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 980141d29c3..c3a3dc56ce2 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -449,7 +449,7 @@ impl RuntimeGlue { fn kill_task(mut handle: KillHandle) { do handle.kill().map_move |killed_task| { let killed_task = Cell::new(killed_task); - do Local::borrow::<Scheduler, ()> |sched| { + do Local::borrow |sched: &mut Scheduler| { sched.enqueue_task(killed_task.take()); } }; @@ -460,7 +460,7 @@ impl RuntimeGlue { unsafe { // Can't use safe borrow, because the taskgroup destructor needs to // access the scheduler again to send kill signals to other tasks. - let me = Local::unsafe_borrow::<Task>(); + let me: *mut Task = Local::unsafe_borrow(); blk((*me).death.kill_handle.get_ref(), (*me).unwinder.unwinding) } } @@ -470,7 +470,7 @@ impl RuntimeGlue { unsafe { // Can't use safe borrow, because creating new hashmaps for the // tasksets requires an rng, which needs to borrow the sched. - let me = Local::unsafe_borrow::<Task>(); + let me: *mut Task = Local::unsafe_borrow(); blk(match (*me).taskgroup { None => { // First task in its (unlinked/unsupervised) taskgroup. @@ -574,7 +574,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { // If child data is 'None', the enlist is vacuously successful. let enlist_success = do child_data.take().map_move_default(true) |child_data| { let child_data = Cell::new(child_data); // :( - do Local::borrow::<Task, bool> |me| { + do Local::borrow |me: &mut Task| { let (child_tg, ancestors) = child_data.take(); let mut ancestors = ancestors; let handle = me.death.kill_handle.get_ref(); @@ -608,7 +608,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { } else { unsafe { // Creating a 1:1 task:thread ... - let sched = Local::unsafe_borrow::<Scheduler>(); + let sched: *mut Scheduler = Local::unsafe_borrow(); let sched_handle = (*sched).make_handle(); // Since this is a 1:1 scheduler we create a queue not in |
