Public Member Functions | |
CThread (IRunnable &runnable) | |
Create a thread to run the supplied instance of IRunnable. | |
CThread (const CThread &rhs) | |
~CThread () override | |
CThread & | operator= (const CThread &rhs) |
void | Start () |
Start the thread running. | |
bool | IsRunning () const |
Returns true if the thread is running. | |
void | SetThreadName (const _tstring &threadName) const |
Sets a threads name so that it can be queried in a debugger. | |
bool | IsThisThread () const |
Returns true if the thread object represents the thread that is calling IsThisThread(). | |
HANDLE | GetWaitHandle () const override |
Access a HANDLE to wait on by passing it to one of the Wait Functions. | |
void | Wait () const override |
Wait indefinitely for the object to become signalled. | |
bool | Wait (Milliseconds timeout) const override |
Wait, with a time limit, for the object to become signalled. If you want to wait for 0 milliseconds and you get an "ambiguous call" with the Handle version then use IsSignalled() which is the same as Wait(0). | |
virtual bool | IsSignalled () const |
Returns true if the object is signalled and false if it isn't; doesn't block. | |
Static Public Member Functions | |
static void | SetCurrentThreadName (const _tstring &threadName) |
Sets the current threads name so that it can be queried in a debugger. | |
static void | SetThreadName (ThreadId threadID, const _tstring &threadName) |
Sets the supplied threads name so that it can be queried in a debugger. | |
static void | WaitForHandle (HANDLE handle) |
Wait indefinitely for the supplied handle to become signalled. | |
static bool | WaitForHandle (HANDLE handle, Milliseconds timeout) |
Wait, with a time limit, for the supplied handle to become signalled. | |
static DWORD | WaitForMultipleHandles (DWORD numHandles, HANDLE *pHandles, bool waitAll, Milliseconds timeout) |
static bool | WaitWithMessageLoop (HANDLE handle, Milliseconds timeout) |
static bool | WaitWithMessageLoop (HANDLE handle, Milliseconds timeout, DWORD removeFlags) |
static bool | WaitWithMessageLoop (DWORD numHandles, const HANDLE *pHandles, Milliseconds timeout) |
static bool | WaitWithMessageLoop (DWORD numHandles, const HANDLE *pHandles, DWORD &signalledHandle, Milliseconds timeout) |
static bool | WaitWithMessageLoop (DWORD numHandles, const HANDLE *pHandles, DWORD &signalledHandle, Milliseconds timeout, DWORD removeFlags) |
static void | AddThreadNameListener (IListenToThreadNaming &listener) |
static void | RemoveThreadNameListener (IListenToThreadNaming &listener) |
static void | AddThreadStartListener (IListenToThreadStart &listener) |
static void | RemoveThreadStartListener (IListenToThreadStart &listener) |
static void | AddThreadStopListener (IListenToThreadStop &listener) |
static void | RemoveThreadStopListener (IListenToThreadStop &listener) |
Protected Member Functions | |
void | NotifyThreadStartListeners () |
void | NotifyThreadStopListeners () |
Static Protected Member Functions | |
static void | SetThreadName (const _tstring &threadID, const _tstring &threadName) |
Create a thread to run the supplied instance of IRunnable.
~CThread | ( | ) | [override] |
void Start | ( | ) |
Start the thread running.
bool IsRunning | ( | ) | const |
Returns true if the thread is running.
void SetThreadName | ( | const _tstring & | threadName | ) | const |
Sets a threads name so that it can be queried in a debugger.
bool IsThisThread | ( | ) | const |
Returns true if the thread object represents the thread that is calling IsThisThread().
void SetCurrentThreadName | ( | const _tstring & | threadName | ) | [static] |
Sets the current threads name so that it can be queried in a debugger.
Sets the supplied threads name so that it can be queried in a debugger.
HANDLE GetWaitHandle | ( | ) | const [override, virtual] |
void Wait | ( | ) | const [override, virtual] |
bool Wait | ( | Milliseconds | timeout | ) | const [override, virtual] |
Wait, with a time limit, for the object to become signalled. If you want to wait for 0 milliseconds and you get an "ambiguous call" with the Handle version then use IsSignalled() which is the same as Wait(0).
Implements IWaitable.
bool IsSignalled | ( | ) | const [virtual, inherited] |
Returns true if the object is signalled and false if it isn't; doesn't block.
void WaitForHandle | ( | HANDLE | handle | ) | [static, inherited] |
Wait indefinitely for the supplied handle to become signalled.
bool WaitForHandle | ( | HANDLE | handle, | |
Milliseconds | timeout | |||
) | [static, inherited] |
Wait, with a time limit, for the supplied handle to become signalled.
DWORD WaitForMultipleHandles | ( | DWORD | numHandles, | |
HANDLE * | pHandles, | |||
bool | waitAll, | |||
Milliseconds | timeout | |||
) | [static, inherited] |
bool WaitWithMessageLoop | ( | HANDLE | handle, | |
Milliseconds | timeout | |||
) | [static, inherited] |
bool WaitWithMessageLoop | ( | HANDLE | handle, | |
Milliseconds | timeout, | |||
DWORD | removeFlags | |||
) | [static, inherited] |
bool WaitWithMessageLoop | ( | DWORD | numHandles, | |
const HANDLE * | pHandles, | |||
Milliseconds | timeout | |||
) | [static, inherited] |
bool WaitWithMessageLoop | ( | DWORD | numHandles, | |
const HANDLE * | pHandles, | |||
DWORD & | signalledHandle, | |||
Milliseconds | timeout | |||
) | [static, inherited] |
bool WaitWithMessageLoop | ( | DWORD | numHandles, | |
const HANDLE * | pHandles, | |||
DWORD & | signalledHandle, | |||
Milliseconds | timeout, | |||
DWORD | removeFlags | |||
) | [static, inherited] |
void AddThreadNameListener | ( | IListenToThreadNaming & | listener | ) | [static, inherited] |
void RemoveThreadNameListener | ( | IListenToThreadNaming & | listener | ) | [static, inherited] |
void AddThreadStartListener | ( | IListenToThreadStart & | listener | ) | [static, inherited] |
void RemoveThreadStartListener | ( | IListenToThreadStart & | listener | ) | [static, inherited] |
void AddThreadStopListener | ( | IListenToThreadStop & | listener | ) | [static, inherited] |
void RemoveThreadStopListener | ( | IListenToThreadStop & | listener | ) | [static, inherited] |
void SetThreadName | ( | const _tstring & | threadID, | |
const _tstring & | threadName | |||
) | [static, protected, inherited] |
void NotifyThreadStartListeners | ( | ) | [protected, inherited] |
void NotifyThreadStopListeners | ( | ) | [protected, inherited] |