about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-08-16 20:14:30 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-23 21:19:59 -0700
commit4c75d36d0e81508d4e7614104abb44fa19179c03 (patch)
tree847657f50fa0d1f7225f0b8cd2dbb2a452ef6875 /src/libstd/rt
parentf9979247d1d69c1a8fb7cd1d2829a629baf9d965 (diff)
downloadrust-4c75d36d0e81508d4e7614104abb44fa19179c03.tar.gz
rust-4c75d36d0e81508d4e7614104abb44fa19179c03.zip
std: Reduce TLS access
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/sched.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs
index 5ec2df32c48..a8f3d01351b 100644
--- a/src/libstd/rt/sched.rs
+++ b/src/libstd/rt/sched.rs
@@ -563,11 +563,10 @@ impl Scheduler {
         // run the cleanup job, as expected by the previously called
         // swap_contexts function.
         unsafe {
-            let sched = Local::unsafe_borrow::<Scheduler>();
-            (*sched).run_cleanup_job();
+            let task = Local::unsafe_borrow::<Task>();
+            (*task).sched.get_mut_ref().run_cleanup_job();
 
             // Must happen after running the cleanup job (of course).
-            let task = Local::unsafe_borrow::<Task>();
             (*task).death.check_killed((*task).unwinder.unwinding);
         }
     }