bool Wait(void)
Waits for the thread to finish.
std::atomic< bool > m_ShouldTerminate
The overriden Execute() method should check this value periodically and terminate if this is true...
void DoExecute(void)
Wrapper for Execute() that waits for the initialization event, to prevent race conditions in thread i...
std::thread m_Thread
The thread object which holds the created thread for later manipulation.
AString m_ThreadName
The name of the thread, used to aid debugging in IDEs which support named threads.
cEvent m_evtStart
The event that is used to wait with the thread's execution until the thread object is fully initializ...
void Stop(void)
Signals the thread to terminate and waits until it's finished.
bool IsCurrentThread(void) const
Returns true if the thread calling this function is the thread contained within this object...
virtual void Execute(void)=0
This is the main thread entrypoint.
bool Start(void)
Starts the thread; returns without waiting for the actual start.
cIsThread(const AString &a_ThreadName)