about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-17 14:59:20 -0800
committerAaron Turon <aturon@mozilla.com>2014-12-18 23:35:52 -0800
commitd08600b189eeb2e61879b44a07f9fdc33fa82689 (patch)
tree274743c02df19bff0de04f5c9098f8c280d29c23 /src/libstd/sys
parent5759cff48e66bcf2bf2cf821211bdf683292d8f3 (diff)
downloadrust-d08600b189eeb2e61879b44a07f9fdc33fa82689.tar.gz
rust-d08600b189eeb2e61879b44a07f9fdc33fa82689.zip
std: Move the panic flag to its own thread local
This flag is somewhat tied to the `unwind` module rather than the `thread_info`
module, so this commit moves it into that module as well as allowing the same OS
thread to call `unwind::try` multiple times. Previously once a thread panicked
its panic flag was never reset, even after exiting the panic handler.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/thread_info.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs
index 92a896c7583..0519bc56f0a 100644
--- a/src/libstd/sys/common/thread_info.rs
+++ b/src/libstd/sys/common/thread_info.rs
@@ -20,7 +20,6 @@ struct ThreadInfo {
     // hence this is optional.
     stack_bounds: (uint, uint),
     stack_guard: uint,
-    unwinding: bool,
     thread: Thread,
 }
 
@@ -38,7 +37,6 @@ impl ThreadInfo {
                 *c.borrow_mut() = Some(ThreadInfo {
                     stack_bounds: (0, 0),
                     stack_guard: 0,
-                    unwinding: false,
                     thread: NewThread::new(None),
                 })
             }
@@ -51,24 +49,15 @@ pub fn current_thread() -> Thread {
     ThreadInfo::with(|info| info.thread.clone())
 }
 
-pub fn panicking() -> bool {
-    ThreadInfo::with(|info| info.unwinding)
-}
-
 pub fn stack_guard() -> uint {
     ThreadInfo::with(|info| info.stack_guard)
 }
 
-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()));
     THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
         stack_bounds: stack_bounds,
         stack_guard: stack_guard,
-        unwinding: false,
         thread: thread,
     }));
 }