std.parallelism.task_pool.worker_local_storage.get
- multiple declarations
- Function TaskPool.WorkerLocalStorage.get
- Function TaskPool.WorkerLocalStorage.get
Function TaskPool.WorkerLocalStorage.get
Get the current thread's instance. Returns by ref.
Note that calling
from any thread
outside the get
that created this instance will return the
same reference, so an instance of worker-local storage should only be
accessed from one thread outside the pool that created it. If this
rule is violated, undefined behavior will result.
TaskPool
If assertions are enabled and
has been called, then this
toRange
WorkerLocalStorage
instance is no longer worker-local and an assertion
failure will result when calling this method. This is not checked
when assertions are disabled for performance reasons.
Prototype
ref T get() @property;
Function TaskPool.WorkerLocalStorage.get
Assign a value to the current thread's instance. This function has the same caveats as its overload.
Prototype
void get( T val ) @property;