-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-thread-localsArea: Thread local storage (TLS)Area: Thread local storage (TLS)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-thread_local`#![feature(thread_local)]``#![feature(thread_local)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team
Description
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)
stepancheg, Speedy37, stanislav-tkach, DianaNites, xsoheilalizadeh and 51 more
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-thread-localsArea: Thread local storage (TLS)Area: Thread local storage (TLS)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-thread_local`#![feature(thread_local)]``#![feature(thread_local)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team