Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cThreadState Class Reference

#include <cThreadLock.h>

Inheritance diagram for Gray::cThreadState:
GrayLib::cJobBase GrayLib::cThread GrayLib::cJobPender GrayLib::cJobUnitTest GrayLib::cJobWaiter GrayLib::cScriptJob GrayLib::cThreadChecked GrayLib::cThreadNamed< cUnitTestHttpClient > GrayLib::cThreadNamed< cNetServerThread > GrayLib::cThreadNamed< cJobThreadSeq > GrayLib::cThreadNamed< cUnitTestSecureClient > GrayLib::cThreadNamed< cJobThread > GrayLib::cThreadNamed< cUnitTestOSPipe > GrayLib::cThreadNamed< cUnitTestXProtocolClient > GrayLib::cThreadNamed< cCmdCPULoadThread > GrayLib::cThreadNamed< cUnitTestSSL > GrayLib::cThreadNamed< cLogThread > GrayLib::cThreadNamed< cUnitTestThread > GrayLib::cThreadNamed< cThreadFiber > GrayLib::cThreadNamed< _TYPE >

Public Member Functions

 cThreadState () noexcept
 
bool isThreadRunning () const noexcept
 
bool isThreadStopping () const noexcept
 
virtual bool RequestStopThread (bool bWillWait=false) noexcept
 

Protected Attributes

bool m_bThreadRunning
 called CreateThread() onThreadCreate(), and inside Run(), until onThreadExit() More...
 
volatile bool m_bThreadStopping
 trying to stop the thread nicely. Do this before TerminateThread() More...
 

Detailed Description

Query the status/state of a thread/job and possibly attempt to cancel it. Similar to ICancellable and useful with IStreamProgressCallback

Constructor & Destructor Documentation

◆ cThreadState()

Gray::cThreadState::cThreadState ( )
inlinenoexcept

Member Function Documentation

◆ isThreadRunning()

bool Gray::cThreadState::isThreadRunning ( ) const
inlinenoexcept

Running. though may be stopping/sleeping/suspended/etc.

◆ isThreadStopping()

bool Gray::cThreadState::isThreadStopping ( ) const
inlinenoexcept

Thread MUST periodically check this !

◆ RequestStopThread()

virtual bool Gray::cThreadState::RequestStopThread ( bool  bWillWait = false)
inlinevirtualnoexcept

Reimplemented in GrayLib::cThread.

Member Data Documentation

◆ m_bThreadRunning

bool Gray::cThreadState::m_bThreadRunning
protected

called CreateThread() onThreadCreate(), and inside Run(), until onThreadExit()

◆ m_bThreadStopping

volatile bool Gray::cThreadState::m_bThreadStopping
protected

trying to stop the thread nicely. Do this before TerminateThread()


The documentation for this class was generated from the following file: