C4 Engine Terathon Software C4 Engine API Documentation

• System Utilities

API Links
Developer Links

class Thread

Defined in:  C4Threads.h
The Thread class encapsulates a thread of execution.
Definition

class Thread

Member Functions
Thread::GetThreadSignal Returns the signal associated with the thread.
Thread::SetThreadSignal Sets the signal associated with the thread.
Thread::SetThreadPriority Sets the priority of a thread.
Thread::Complete Indicates whether a thread has completed execution.
Thread::Sleep Suspends the current thread for a period of time.
Thread::Yield Yields the time slice for the current thread.
Constructor

Thread(ThreadProc *proc, void *data, unsigned long stack = 0, Signal *signal = nullptr);

Parameters
proc The entry point for the thread.
data A pointer to user-defined data that is passed to the thread's entry point.
stack The thread's stack size in bytes. If this is 0, then the default stack size is used.
signal The signal object to assign to the thread.
Description
The Thread class defines a platform-independent thread object that can be used to achieve multithreaded execution. When a new Thread object is constructed, its entry function, specified by the proc parameter begins executing immediately. The pointer passed into the data parameter is passed to the thread's entry function, which must have the following signature.

typedef void ThreadProc(const Thread *, void *);

See Also

Lock

Mutex

Signal