Open
Description
opened on Nov 5, 2015
The #[thread_local]
attribute is currently feature-gated. This issue tracks its stabilization.
Known problems:
-
#[thread_local]
translates directly to thethread_local
attribute in LLVM. This isn't supported on all platforms, and it's not even supported on all distributions within the same platform (e.g. macOS 10.6 didn't support it but 10.7 does). I don't think this is necessarily a blocker, but I also don't think we have many attributes and such which are so platform specific like this. - Statics that are thread local shouldn't require
Sync
- #[thread_local] statics shouldn't require Sync #18001 - Statics that are thread local should either not borrow for the
'static
lifetime or should be unsafe to access - Safe access to a#[thread_local]
should be disallowed #17954 - Statics can currently reference other thread local statics, but this is a bug - Statics should not be able to take the address of a thread_local static #18712
- Unsound with generators Keeping references to #[thread_local] statics is allowed across yields. #49682
- static mut can be given
'static
lifetime with NLL (#[thread_local] static mut
is allowed to have'static
lifetime #54366)
Metadata
Assignees
Labels
Area: Foreign function interface (FFI)Area: Thread local storage (TLS)Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(thread_local)]`Status: The implementation is incomplete.Relevant to the language team, which will review and decide on the PR/issue.
Activity