View source code Display the source code in std/parallelism.d from which this page was generated on github. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone. Page wiki View or edit the community-maintained wiki page associated with this page.

std.parallelism.task_pool.worker_local_storage.get - multiple declarations

Function TaskPool.WorkerLocalStorage.get

Get the current thread's instance. Returns by ref. Note that calling get from any thread outside the TaskPool 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.

If assertions are enabled and toRange has been called, then this 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;

Authors

License

Boost License 1.0

Comments