core::rt: 0 is a valid TLS key

This commit is contained in:
Brian Anderson
2013-05-06 18:53:45 -07:00
parent d234cf7e44
commit 101aaa3861
2 changed files with 3 additions and 3 deletions

View File

@@ -119,7 +119,7 @@ fn maybe_tls_key() -> Option<tls::Key> {
// another thread. I think this is fine since the only action
// they could take if it was initialized would be to check the
// thread-local value and see that it's not set.
if key != 0 {
if key != -1 {
return Some(key);
} else {
return None;

View File

@@ -830,9 +830,9 @@ rust_get_rt_env() {
}
#ifndef _WIN32
pthread_key_t sched_key;
pthread_key_t sched_key = -1;
#else
DWORD sched_key;
DWORD sched_key = -1;
#endif
extern "C" void*