]> git.lizzy.rs Git - rust.git/commitdiff
Implement TLS scoped keys, compiler builtins
authorJeremy Soller <jackpot51@gmail.com>
Sun, 30 Oct 2016 22:14:47 +0000 (16:14 -0600)
committerJeremy Soller <jackpot51@gmail.com>
Sun, 30 Oct 2016 22:14:47 +0000 (16:14 -0600)
src/libstd/lib.rs
src/libstd/sys/redox/thread_local.rs

index 219f244be29cc33b5e89d167afd0520d13a2b08e..82a719693ec03ab7a10cff040075012dfcb0622c 100644 (file)
 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;
index b12ffebbcac1d6a7c370f5be1ce2247b5698bf00..7958437a30a5a774e801f3e00f4d9ea0d765f488 100644 (file)
 
 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<Key, (*mut u8, Option<Dtor>)> = ptr::null_mut();
 
 unsafe fn locals() -> &'static mut BTreeMap<Key, (*mut u8, Option<Dtor>)> {