about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-02 09:19:45 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-02 09:19:45 -0800
commit4b0e084aa12cbc25bb2314997b65d28fb6a31692 (patch)
tree6f7cceb6ca531145c124d6fd2c092c192ac05d71 /src/libstd/sys
parent009ec5d2b0c4ab0e7dc7ab2f6b15754b4da14caf (diff)
parentbe11aa6d70c90185db715328ef2b24a3621cb969 (diff)
downloadrust-4b0e084aa12cbc25bb2314997b65d28fb6a31692.tar.gz
rust-4b0e084aa12cbc25bb2314997b65d28fb6a31692.zip
rollup merge of #20354: alexcrichton/second-pass-thread_local
Conflicts:
	src/libstd/sys/common/thread_info.rs
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/thread_info.rs5
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");
         }