Module tls

Source
Expand description

no_std thread-local storage

This module provides a level of indirection for thread-local storage, with different options trading off performance and stability. See Mode for more about each of these.

Structs§

ShimTlsVar
Thread local storage for a variable of type T, initialized on first access by each thread using a function of type F.
ThreadLocalStorage
Provider for thread local storage. For non-test usage, there should generally be a single process-wide instance.
ThreadLocalStorageKey
An opaque, per-thread identifier. These are only guaranteed to be unique for live threads. See ThreadLocalStorage::unregister_current_thread.
TlsOneThreadStorageAllocation
This is a “proxy” type to TlsOneThreadStorage with the same size and alignment.
TlsVarRef
A reference to a single thread’s instance of a TLS variable ShimTlsVar.

Enums§

Mode
Modes of operation for this module.

Constants§

BYTES_PER_THREAD
This needs to be big enough to store all thread-local variables for a single thread. We fail at runtime if this limit is exceeded.