Threadclass encapsulates a thread of execution.
||Returns the signal associated with the thread.|
||Sets the signal associated with the thread.|
||Sets the priority of a thread.|
||Indicates whether a thread has completed execution.|
Thread(ThreadCallback *callback, void *cookie, uint32 stack = 0, Signal *signal = nullptr);
||The entry point for the thread.|
||A pointer to user-defined data that is passed to the thread's entry point.|
||The thread's stack size in bytes. If this is 0, then the default stack size is used.|
||The signal object to assign to the thread.|
Threadclass defines a platform-independent thread object that can be used to achieve multithreaded execution. When a new
Threadobject is constructed, the entry function specified by the
callbackparameter begins executing immediately. The pointer passed into the
cookieparameter is passed to the thread's entry function, which must have the following signature.
typedef void ThreadCallback(const Thread *, void *);
stackparameter is not zero, then it specifies the size of the stack allocated for the thread. Otherwise, the default stack size, as determined by the operating system, is used.
signalparameter is not
nullptr, then it specifies a
Signalobject that is assigned to the thread. When a
Threadobject is destroyed and it has a
Signalobject assigned to it, the thread triggers signal 0 to indicate that the thread should exit.