summary refs log tree commit diff
path: root/library/std/src/sys/thread_local
AgeCommit message (Collapse)AuthorLines
2024-06-04Auto merge of #125525 - joboet:tls_accessor, r=cuviperbors-172/+103
Make TLS accessors closures that return pointers The current TLS macros generate a function that returns an `Option<&'static T>`. This is both risky as we lie about lifetimes, and necessitates that those functions are `unsafe`. By returning a `*const T` instead, the accessor function do not have safety requirements any longer and can be made closures without hassle. This PR does exactly that! For native TLS, the closure approach makes it trivial to select the right accessor function at compile-time, which could result in a slight speed-up (I have the hope that the accessors are now simple enough for the MIR-inliner to kick in).
2024-06-02typo: depending from -> onRalf Jung-1/+1
2024-05-25std: make TLS accessors closures that return pointersjoboet-172/+103
2024-05-24std: clean up the TLS implementationjoboet-3/+4
2024-05-24std: simplify key-based thread localsjoboet-185/+60
2024-05-24Auto merge of #123724 - joboet:static_tls, r=m-ou-sebors-70/+76
Rewrite TLS on platforms without threads The saga of #110897 continues! r? `@m-ou-se` if you have time
2024-05-23std: rewrite native thread-local storagejoboet-248/+330
2024-04-30std: rewrite TLS on platforms without threadsjoboet-70/+76
2024-04-26thread_local: refine LazyKeyInner::take safety docJubilee-1/+1
Co-authored-by: joboet <jonasboettiger@icloud.com>
2024-04-25thread_local: split refs to fields of KeyJubilee Young-3/+4
2024-04-25thread_local: use less &mut T in LazyKeyInner::takeJubilee Young-6/+8
Instead, use raw pointers to accomplish internal mutability throughout.
2024-04-15static_mut_refs: use raw pointers to remove the remaining FIXMERalf Jung-3/+2
2024-03-20step cfgsMark Rousskov-2/+1
2024-03-16Use `UnsafeCell` for fast constant thread localsJohn Kåre Alsaker-8/+7
2024-02-28std: move thread local implementation to `sys`joboet-0/+664