From 4edcddfb618a6d684d1f3289706ecc7794b30278 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 30 Oct 2016 16:14:47 -0600 Subject: [PATCH] Implement TLS scoped keys, compiler builtins --- src/libstd/lib.rs | 2 +- src/libstd/sys/redox/thread_local.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 219f244be29..82a719693ec 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -322,7 +322,7 @@ extern crate alloc_system; // compiler-rt intrinsics -//REDOX TODO extern crate compiler_builtins; +extern crate compiler_builtins; // Make std testable by not duplicating lang items and other globals. See #2912 #[cfg(test)] extern crate std as realstd; diff --git a/src/libstd/sys/redox/thread_local.rs b/src/libstd/sys/redox/thread_local.rs index b12ffebbcac..7958437a30a 100644 --- a/src/libstd/sys/redox/thread_local.rs +++ b/src/libstd/sys/redox/thread_local.rs @@ -17,10 +17,10 @@ type Dtor = unsafe extern fn(*mut u8); -//TODO: Implement this properly - +#[thread_local] static mut NEXT_KEY: Key = 0; +#[thread_local] static mut LOCALS: *mut BTreeMap)> = ptr::null_mut(); unsafe fn locals() -> &'static mut BTreeMap)> {