Skip to content

Commit

Permalink
Document reasoning for supporting both fast and OS TLS in the same bin
Browse files Browse the repository at this point in the history
  • Loading branch information
brson committed Nov 1, 2016
1 parent 5688407 commit 8b2600d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/libstd/thread/mod.rs
Expand Up @@ -181,6 +181,15 @@ use time::Duration;
#[stable(feature = "rust1", since = "1.0.0")]
pub use self::local::{LocalKey, LocalKeyState};

// The types used by the thread_local! macro to access TLS keys. Note that there
// are two types, the "OS" type and the "fast" type. The OS thread local key
// type is accessed via platform-specific API calls and is slow, while the fast
// key type is accessed via code generated via LLVM, where TLS keys are set up
// by the elf linker. Note that the OS TLS type is always available: on macOS
// the standard library is compiled with support for older platform versions
// where fast TLS was not available; end-user code is compiled with fast TLS
// where available, but both are needed.

#[unstable(feature = "libstd_thread_internals", issue = "0")]
#[cfg(target_thread_local)]
#[doc(hidden)] pub use sys::fast_thread_local::Key as __FastLocalKeyInner;
Expand Down

0 comments on commit 8b2600d

Please sign in to comment.