about summary refs log tree commit diff
path: root/library/std/src/thread/local
AgeCommit message (Collapse)AuthorLines
2023-01-09std test: better type name, clarifying commentRalf Jung-11/+11
2022-11-12avoid using channels in thread-local testsIbraheem Ahmed-22/+44
2021-06-20Squashed implementation of the passAlex Vlasov-1/+1
2021-05-06join_orders_after_tls_destructors: ensure thread 2 is launched before thread ↵Mohsen Zohrevandi-8/+9
1 enters TLS destructors
2021-04-29Use atomics in join_orders_after_tls_destructors testMohsen Zohrevandi-34/+88
std::sync::mpsc uses thread locals and depending on the order TLS dtors are run `rx.recv()` can panic when used in a TLS dtor.
2021-04-21Ensure TLS destructors run before thread joins in SGXMohsen Zohrevandi-1/+54
2021-04-16std: Add a variant of thread locals with const initAlex Crichton-46/+101
This commit adds a variant of the `thread_local!` macro as a new `thread_local_const_init!` macro which requires that the initialization expression is constant (e.g. could be stuck into a `const` if so desired). This form of thread local allows for a more efficient implementation of `LocalKey::with` both if the value has a destructor and if it doesn't. If the value doesn't have a destructor then `with` should desugar to exactly as-if you use `#[thread_local]` given sufficient inlining. The purpose of this new form of thread locals is to precisely be equivalent to `#[thread_local]` on platforms where possible for values which fit the bill (those without destructors). This should help close the gap in performance between `thread_local!`, which is safe, relative to `#[thread_local]`, which is not easy to use in a portable fashion.
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-0/+194
Also doing fmt inplace as requested.