about summary refs log tree commit diff
path: root/src/libcore/sys.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/sys.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/sys.rs')
-rw-r--r--src/libcore/sys.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs
index 962295e0b8a..137070ce202 100644
--- a/src/libcore/sys.rs
+++ b/src/libcore/sys.rs
@@ -195,7 +195,8 @@ impl FailWithCause for &'static str {
 pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
     use option::Option;
     use rt::{context, OldTaskContext, TaskContext};
-    use rt::local_services::{unsafe_borrow_local_services, Unwinder};
+    use rt::task::{Task, Unwinder};
+    use rt::local::Local;
 
     let context = context();
     match context {
@@ -224,8 +225,8 @@ pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
 
                 gc::cleanup_stack_for_failure();
 
-                let local_services = unsafe_borrow_local_services();
-                let unwinder: &mut Option<Unwinder> = &mut (*local_services).unwinder;
+                let task = Local::unsafe_borrow::<Task>();
+                let unwinder: &mut Option<Unwinder> = &mut (*task).unwinder;
                 match *unwinder {
                     Some(ref mut unwinder) => unwinder.begin_unwind(),
                     None => abort!("failure without unwinder. aborting process")