std::atomic< bool > m_ShouldTerminate
The overriden Execute() method should check this value periodically and terminate if this is true.
cIsThread(AString &&a_ThreadName)
void Stop(void)
Signals the thread to terminate and waits until it's finished.
void Entrypoint(void)
This is the main thread entrypoint.
AString m_ThreadName
The name of the thread, used to aid debugging in IDEs which support named threads.
std::thread m_Thread
The thread object which holds the created thread for later manipulation.
bool IsCurrentThread(void) const
Returns true if the thread calling this function is the thread contained within this object.
cEvent m_Initialisation
The event that is used to wait with the thread's execution until the thread object is fully initializ...
void Start(void)
Starts the thread; returns without waiting for the actual start.
virtual void Execute(void)=0
This function, overloaded by the descendants, is called in the new thread.
void SetThreadName() const
Sets the name of the current thread to be the name provided in m_ThreadName.