Skip to content

Commit 4edcddf

Browse files
committed
Implement TLS scoped keys, compiler builtins
1 parent 37bfef0 commit 4edcddf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libstd/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ extern crate unwind;
322322
extern crate alloc_system;
323323

324324
// compiler-rt intrinsics
325-
//REDOX TODO extern crate compiler_builtins;
325+
extern crate compiler_builtins;
326326

327327
// Make std testable by not duplicating lang items and other globals. See #2912
328328
#[cfg(test)] extern crate std as realstd;

src/libstd/sys/redox/thread_local.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ pub type Key = usize;
1717

1818
type Dtor = unsafe extern fn(*mut u8);
1919

20-
//TODO: Implement this properly
21-
20+
#[thread_local]
2221
static mut NEXT_KEY: Key = 0;
2322

23+
#[thread_local]
2424
static mut LOCALS: *mut BTreeMap<Key, (*mut u8, Option<Dtor>)> = ptr::null_mut();
2525

2626
unsafe fn locals() -> &'static mut BTreeMap<Key, (*mut u8, Option<Dtor>)> {

0 commit comments

Comments
 (0)