ThreadBase

//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

Constructors

this
this(void function() fn, size_t sz)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

this
this(size_t sz)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

Members

Functions

destructBeforeDtor
bool destructBeforeDtor()

Cleans up any remaining resources used by this object.

join
Throwable join(bool rethrow)

Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown.

pushContext
void pushContext(StackContext* c)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

Properties

id
ThreadID id [@property getter]

Gets the OS identifier for this thread.

isDaemon
bool isDaemon [@property getter]

Gets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not prevent the process from terminating. In effect, daemon threads will be terminated automatically by the OS when the process exits.

isDaemon
bool isDaemon [@property setter]

Sets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not prevent the process from terminating. In effect, daemon threads will be terminated automatically by the OS when the process exits.

isMainThread
bool isMainThread [@property getter]

Tests whether this thread is the main thread, i.e. the thread that initialized the runtime

isRunning
bool isRunning [@property getter]

Tests whether this thread is running.

name
string name [@property getter]

Gets the user-readable label for this thread.

name
string name [@property setter]

Sets the user-readable label for this thread.

slock
Mutex slock [@property getter]

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

Static functions

add
void add(StackContext* c)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

add
void add(ThreadBase t, bool rmAboutToStart)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

getAll
ThreadBase[] getAll()

Provides a list of all threads currently being tracked by the system. Note that threads in the returned array might no longer run (see ThreadBase..isRunning).

getThis
ThreadBase getThis()

Provides a reference to the calling thread.

opApply
int opApply(int delegate(ref ThreadBase) dg)

Operates on all threads currently being tracked by the system. The result of deleting any Thread object is undefined. Note that threads passed to the callback might no longer run (see ThreadBase..isRunning).

setThis
void setThis(ThreadBase t)

//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////

Meta