core::rt: 0 is a valid TLS key
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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*
|
||||
|
||||
Reference in New Issue
Block a user