Initializes a thread object which is associated with a static D function.
Initializes a thread object which is associated with a dynamic D function.
Cleans up any remaining resources used by this object.
Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown.
Starts the thread and invokes the function or delegate passed upon construction.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
The default scheduling priority that is set for a thread. On systems where multiple scheduling policies are defined, this value represents the default priority for the scheduling policy of the process.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
The maximum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the maximum valid priority for the scheduling policy of the process.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
The minimum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the minimum valid priority for the scheduling policy of the process.
Tests whether this thread is running.
Gets the scheduling priority for the associated thread.
Sets the scheduling priority for the associated thread.
Provides a reference to the calling thread.
Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system.
Forces a context switch to occur away from the calling thread.
Cleans up any remaining resources used by this object.
Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown.
Gets the OS identifier for this thread.
Gets the user-readable label for this thread.
Sets the user-readable label for this thread.
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.
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.
Tests whether this thread is the main thread, i.e. the thread that initialized the runtime
Tests whether this thread is running.
Provides a reference to the calling thread.
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).
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).
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
This class encapsulates all threading functionality for the D programming language. As thread manipulation is a required facility for garbage collection, all user threads should derive from this class, and instances of this class should never be explicitly deleted. A new thread may be created using either derivation or composition, as in the following example.