rust/library/std/src/sys/thread_local/key
joboet 8bf515330f
std: abort the process on failure to allocate a TLS key
The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see https://github.com/rust-lang/rust/issues/140798#issuecomment-2872307377). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
2025-05-23 18:00:09 +02:00
..
racy.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00
sgx.rs std: refactor the TLS implementation 2024-06-15 17:47:35 +02:00
tests.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
unix.rs std: abort the process on failure to allocate a TLS key 2025-05-23 18:00:09 +02:00
windows.rs std: abort the process on failure to allocate a TLS key 2025-05-23 18:00:09 +02:00
xous.rs use generic Atomic type where possible 2025-04-27 02:18:08 +03:00