InspIRCd  2.0
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Thread Class Referenceabstract

#include <threadengine.h>

Inheritance diagram for Thread:
ConfigReaderThread QueuedThread SocketThread TestSuiteThread

Public Member Functions

 Thread ()
virtual ~Thread ()
virtual void Run ()=0
virtual void SetExitFlag ()
void join ()

Public Attributes


Protected Member Functions

bool GetExitFlag ()

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!

Constructor & Destructor Documentation

◆ Thread()

Thread::Thread ( )

Set Creator to NULL at this point

◆ ~Thread()

Thread::~Thread ( )

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

Member Function Documentation

◆ GetExitFlag()

bool Thread::GetExitFlag ( )

Get thread's current exit status. (are we being asked to exit?)

◆ join()

void Thread::join ( )

Join the thread (calls SetExitFlag and waits for exit)

◆ Run()

virtual void Thread::Run ( )
pure virtual

Override this method to put your actual threaded code here.

Implemented in TestSuiteThread, and ConfigReaderThread.

◆ SetExitFlag()

void Thread::SetExitFlag ( )

Signal the thread to exit gracefully.

Reimplemented in SocketThread, and QueuedThread.

Member Data Documentation

◆ state

ThreadData* Thread::state

Opaque thread state managed by threading engine

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