Public Member Functions | |
WorkerThread (Win32::CIOCompletionPort &iocp, JetByteTools::Core::CManualResetEvent *pMessageReceivedEvent, JetByteTools::Core::CManualResetEvent *pShutdownEvent, IManageThreadPoolThreads &pool, JetByteTools::Core::IThreadPoolWorkerThreadFactory &workerThreadFactory, const ThreadIdentifier &threadIdentifier) | |
WorkerThread (const WorkerThread &rhs) | |
~WorkerThread () override | |
WorkerThread & | operator= (const WorkerThread &rhs) |
void | Start () |
Start the thread running. | |
void | Start (bool startSuspended) |
Start the thread running and optionally start it in a suspended state. | |
void | StartSuspended () |
Start the thread in a suspended state. | |
void | StartWithPriority (int priority) |
Start the thread with the specified thread priority. | |
void | Resume () |
Resume a suspended thread. | |
void | Terminate (DWORD exitCode=0) |
Terminate a thread and have it return the supplied exit code. Note that this should be used with great care! | |
bool | IsRunning () const |
Returns true if the thread is running. | |
void | SetThreadName (const Core::_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 | EnableThreadPriorityBoost () |
void | DisableThreadPriorityBoost () |
bool | ThreadPriorityBoostEnabled () const |
void | SetThreadPriority (int priority) |
int | GetThreadPriority () const |
HANDLE | GetWaitHandle () const override |
void | Wait () const override |
bool | Wait (Milliseconds timeout) const override |
Static Public Member Functions | |
static void | SetThreadName (DWORD threadID, const Core::_tstring &threadName) |
Sets the supplied threads name so that it can be queried in a debugger. | |
static void | SetCurrentThreadName (const Core::_tstring &threadName) |
Sets the current threads name so that it can be queried in a debugger. | |
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) |
WorkerThread | ( | Win32::CIOCompletionPort & | iocp, | |
JetByteTools::Core::CManualResetEvent * | pMessageReceivedEvent, | |||
JetByteTools::Core::CManualResetEvent * | pShutdownEvent, | |||
IManageThreadPoolThreads & | pool, | |||
JetByteTools::Core::IThreadPoolWorkerThreadFactory & | workerThreadFactory, | |||
const ThreadIdentifier & | threadIdentifier | |||
) |
WorkerThread | ( | const WorkerThread & | rhs | ) |
~WorkerThread | ( | ) | [override] |
WorkerThread& operator= | ( | const WorkerThread & | rhs | ) |
void Start | ( | ) | [inherited] |
Start the thread running.
void Start | ( | bool | startSuspended | ) | [inherited] |
Start the thread running and optionally start it in a suspended state.
void StartSuspended | ( | ) | [inherited] |
Start the thread in a suspended state.
void StartWithPriority | ( | int | priority | ) | [inherited] |
Start the thread with the specified thread priority.
void Resume | ( | ) | [inherited] |
Resume a suspended thread.
void Terminate | ( | DWORD | exitCode = 0 |
) | [inherited] |
Terminate a thread and have it return the supplied exit code. Note that this should be used with great care!
bool IsRunning | ( | ) | const [inherited] |
Returns true if the thread is running.
void SetThreadName | ( | const Core::_tstring & | threadName | ) | const [inherited] |
Sets a threads name so that it can be queried in a debugger.
static void SetThreadName | ( | DWORD | threadID, | |
const Core::_tstring & | threadName | |||
) | [static, inherited] |
Sets the supplied threads name so that it can be queried in a debugger.
void SetThreadName | ( | const _tstring & | threadID, | |
const _tstring & | threadName | |||
) | [static, protected, inherited] |
bool IsThisThread | ( | ) | const [inherited] |
Returns true if the thread object represents the thread that is calling IsThisThread().
static void SetCurrentThreadName | ( | const Core::_tstring & | threadName | ) | [static, inherited] |
Sets the current threads name so that it can be queried in a debugger.
void EnableThreadPriorityBoost | ( | ) | [inherited] |
void DisableThreadPriorityBoost | ( | ) | [inherited] |
bool ThreadPriorityBoostEnabled | ( | ) | const [inherited] |
void SetThreadPriority | ( | int | priority | ) | [inherited] |
int GetThreadPriority | ( | ) | const [inherited] |
HANDLE GetWaitHandle | ( | ) | const [override, inherited] |
void Wait | ( | ) | const [override, inherited] |
bool Wait | ( | Milliseconds | timeout | ) | const [override, 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 NotifyThreadStartListeners | ( | ) | [protected, inherited] |
void NotifyThreadStopListeners | ( | ) | [protected, inherited] |