ThreadBase

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

Constructors

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

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

this
this(void delegate() dg, size_t sz)
Undocumented in source.
this
this(size_t sz)

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

Members

Functions

destroyDataStorage
void destroyDataStorage()
Undocumented in source. Be warned that the author may not have intended to support it.
destroyDataStorageIfAvail
void destroyDataStorageIfAvail()
Undocumented in source. Be warned that the author may not have intended to support it.
destructBeforeDtor
bool destructBeforeDtor()

Cleans up any remaining resources used by this object.

initDataStorage
void initDataStorage()
Undocumented in source. Be warned that the author may not have intended to support it.
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.

popContext
void popContext()
Undocumented in source.
pushContext
void pushContext(StackContext* c)

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

run
void run()
Undocumented in source. Be warned that the author may not have intended to support it.
tlsGCdataInit
void tlsGCdataInit()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

criticalRegionLock
Mutex criticalRegionLock [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
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(ThreadBase t, bool rmAboutToStart)

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

add
void add(StackContext* c)

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

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.

initLocks
void initLocks()
Undocumented in source. Be warned that the author may not have intended to support it.
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).

remove
void remove(StackContext* c)
Undocumented in source.
remove
void remove(ThreadBase t)
Undocumented in source.
setThis
void setThis(ThreadBase t)

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

termLocks
void termLocks()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

nAboutToStart
size_t nAboutToStart;
Undocumented in source.
pAboutToStart
ThreadBase* pAboutToStart;
Undocumented in source.
sm_cbeg
StackContext* sm_cbeg;
Undocumented in source.
sm_main
ThreadBase sm_main;
Undocumented in source.
sm_tbeg
ThreadBase sm_tbeg;
Undocumented in source.
sm_this
ThreadBase sm_this;
Undocumented in source.
sm_tlen
size_t sm_tlen;
Undocumented in source.

Variables

m_addr
ThreadID m_addr;
Undocumented in source.
m_call
Callable m_call;
Undocumented in source.
m_curr
StackContext* m_curr;
Undocumented in source.
m_isDaemon
bool m_isDaemon;
Undocumented in source.
m_isInCriticalRegion
bool m_isInCriticalRegion;
Undocumented in source.
m_lock
bool m_lock;
Undocumented in source.
m_main
StackContext m_main;
Undocumented in source.
m_name
string m_name;
Undocumented in source.
m_sz
size_t m_sz;
Undocumented in source.
m_unhandled
Throwable m_unhandled;
Undocumented in source.
next
ThreadBase next;
Undocumented in source.
prev
ThreadBase prev;
Undocumented in source.

Meta