The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CThread Class Reference

Inheritance diagram for CThread:
Collaboration diagram for CThread:

List of all members.

Public Member Functions

 CThread (IRunnable &runnable)
 Create a thread to run the supplied instance of IRunnable.
 CThread (const CThread &rhs)
 ~CThread () override
CThreadoperator= (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 - NOT SUPPORTED.
bool IsThisThread () const
 Returns true if the thread object represents the thread that is calling IsThisThread().
HANDLE GetWaitHandle () const override
void Wait () const override
bool Wait (Milliseconds timeout) const override

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 (std::thread::id threadID, const _tstring &threadName)
 Sets the supplied 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)

Classes

struct  ThreadData


Constructor & Destructor Documentation

CThread ( IRunnable runnable  )  [explicit]

Create a thread to run the supplied instance of IRunnable.

CThread ( const CThread rhs  ) 

~CThread (  )  [override]


Member Function Documentation

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 - NOT SUPPORTED.

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.

void SetThreadName ( std::thread::id  threadID,
const _tstring threadName 
) [static]

Sets the supplied threads name so that it can be queried in a debugger.

HANDLE GetWaitHandle (  )  const [override]

void Wait (  )  const [override]

bool Wait ( Milliseconds  timeout  )  const [override]

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]


Generated on Sun Sep 12 19:08:59 2021 for The Server Framework - v7.4 by doxygen 1.5.3