about summary refs log tree commit diff
path: root/src/libstd/sys/common/thread_info.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys/common/thread_info.rs')
-rw-r--r--src/libstd/sys/common/thread_info.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs
index f88fd49ab99..0612448cfa0 100644
--- a/src/libstd/sys/common/thread_info.rs
+++ b/src/libstd/sys/common/thread_info.rs
@@ -33,11 +33,11 @@ impl ThreadInfo {
                 *c.borrow_mut() = Some(ThreadInfo {
                     stack_bounds: (0, 0),
                     stack_guard: 0,
-                    unwinder: false,
-                    thread: Thread::new(None),
+                    unwinding: false,
+                    thread: NewThread::new(None),
                 })
             }
-            f(c.borrow_mut().as_ref().unwrap())
+            f(c.borrow_mut().as_mut().unwrap())
         })
     }
 }
@@ -47,28 +47,25 @@ pub fn current_thread() -> Thread {
 }
 
 pub fn panicking() -> bool {
-    ThreadInfo::with(|info| info.unwinder.unwinding())
+    ThreadInfo::with(|info| info.unwinding)
 }
 
 pub fn stack_guard() -> uint {
     ThreadInfo::with(|info| info.stack_guard)
 }
 
-pub fn unwinding() -> bool {
-    ThreadInfo::with(|info| info.unwinder.unwinding)
-}
-
 pub fn set_unwinding(unwinding: bool) {
     ThreadInfo::with(|info| info.unwinding = unwinding)
 }
 
 pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
     THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
+    let mut thread_opt = Some(thread); // option dance
     THREAD_INFO.with(|c| *c.borrow_mut() = Some(ThreadInfo{
         stack_bounds: stack_bounds,
         stack_guard: stack_guard,
         unwinding: false,
-        thread: thread,
+        thread: thread_opt.take().unwrap(),
     }));
 }