The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Thread Class Reference

Derive from this class to implement your own threaded sections of code. More...

#include <threadengine.h>

Inheritance diagram for Thread:

Inheritance graph
[legend]
Collaboration diagram for Thread:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Thread ()
 Set Creator to NULL at this point.
virtual ~Thread ()
 If this thread has a Creator set, call it to free the thread.
virtual void Run ()=0
 Override this method to put your actual threaded code here.
void SetExitFlag ()
 Signal the thread to exit gracefully.
void ClearExitFlag ()
 Cancel an exit state.
bool GetExitFlag ()
 Get thread's current exit status.

Public Attributes

ThreadEngineCreator
 Creator thread engine.

Private Attributes

bool ExitFlag
 Set to true when the thread is to exit.

Detailed Description

Derive from this class to implement your own threaded sections of code.

Be sure to keep your code thread-safe and not prone to deadlocks and race conditions if you MUST use threading!

Definition at line 156 of file threadengine.h.


Constructor & Destructor Documentation

Thread::Thread  )  [inline]
 

Set Creator to NULL at this point.

Definition at line 170 of file threadengine.h.

virtual Thread::~Thread  )  [inline, virtual]
 

If this thread has a Creator set, call it to free the thread.

Definition at line 177 of file threadengine.h.


Member Function Documentation

void Thread::ClearExitFlag  )  [inline]
 

Cancel an exit state.

Definition at line 197 of file threadengine.h.

bool Thread::GetExitFlag  )  [inline]
 

Get thread's current exit status.

(are we being asked to exit?)

Definition at line 205 of file threadengine.h.

Referenced by TestSuiteThread::Run().

virtual void Thread::Run  )  [pure virtual]
 

Override this method to put your actual threaded code here.

Implemented in TestSuiteThread, QueryThread, DispatcherThread, and ConfigReaderThread.

void Thread::SetExitFlag  )  [inline]
 

Signal the thread to exit gracefully.

Definition at line 190 of file threadengine.h.

Referenced by ConfigReaderThread::Run().


Member Data Documentation

ThreadEngine* Thread::Creator
 

Creator thread engine.

Definition at line 166 of file threadengine.h.

bool Thread::ExitFlag [private]
 

Set to true when the thread is to exit.

Definition at line 161 of file threadengine.h.


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