diff options
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/thread_info.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs index 8c76eb1504d..92b936e74f6 100644 --- a/src/libstd/sys/common/thread_info.rs +++ b/src/libstd/sys/common/thread_info.rs @@ -10,9 +10,10 @@ use core::prelude::*; -use thread::Thread; use cell::RefCell; use string::String; +use thread::Thread; +use thread_local::State; struct ThreadInfo { // This field holds the known bounds of the stack in (lo, hi) @@ -27,7 +28,7 @@ thread_local! { static THREAD_INFO: RefCell<Option<ThreadInfo>> = RefCell::new(N impl ThreadInfo { fn with<R, F>(f: F) -> R where F: FnOnce(&mut ThreadInfo) -> R { - if THREAD_INFO.destroyed() { + if THREAD_INFO.state() == State::Destroyed { panic!("Use of std::thread::Thread::current() is not possible after \ the thread's local data has been destroyed"); } |
