juno.base.threading Module

Licence
See licence.txt for use and distribution terms.

class ThreadLocal(T);

Provides thread-local variables.

this(lazy T defaultValue = T.init);

Initializes a new instance.

T get();

Gets the value in the current thread's copy of this instance.

Returns
The current thread's copy of this instance.

void set(T value);

Sets the current thread's copy of this instance to the specified value.

Parameters
T value
The value to be stored in the current thread's copy of this instance.

void sleep(uint milliseconds);

Suspends the current thread for a specified time.

Parameters
uint milliseconds
The number of milliseconds for which the thread is blocked. Specify -1 to block the thread indefinitely.

void sleep(TimeSpan timeout);

Suspends the current thread for a specified time.

Parameters
TimeSpan timeout
The amount of time for which the thread is blocked. Specify -1 to block the thread indefinitely.