Thread

A thread of execution.

Constructors

this
this()

Creates a new thread executing the "onExecute" virtual function.

this
this(void delegate() callback)

Creates a new thread.

this
this(void function() callback)

Creates a new thread.

this
this(void function(T) callback, T data)

Creates a new thread.

Members

Functions

cancel
Thread cancel()

Forcefully cancels the thread, stopping execution.

join
bool join(uint timeout, bool rethrow)

Blocks the calling thread until the given thread completes.

onExecute
void onExecute()

Virtual function which may be overridden.

start
Thread start()

Starts executing the thread.

Properties

isRunning
bool isRunning [@property getter]

Whether the thread is currently running.

nativeHandle
it.NativeThread nativeHandle [@property getter]

The native implementation defined handle of the thread.

selfTid
ThreadId selfTid [@property getter]

The Thread ID of the calling thread.

tid
ThreadId tid [@property getter]

The thread Id of the given thread.

Static functions

sleep
void sleep(uint ms)

Makes the calling thread sleep for the specified amount of time.

Meta