InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Public Member Functions | Static Public Member Functions | List of all members
ThreadEngine Class Reference

#include <threadengine_pthread.h>

Public Member Functions

 ThreadEngine ()
 
virtual ~ThreadEngine ()
 
void Start (Thread *thread_to_init)
 
const std::string GetName ()
 
void Start (Thread *thread_to_init)
 
const std::string GetName ()
 

Static Public Member Functions

static DWORD WINAPI Entry (void *parameter)
 

Detailed Description

The ThreadEngine class has the responsibility of initialising Thread derived classes. It does this by creating operating system level threads which are then associated with the class transparently. This allows Thread classes to be derived without needing to know how the OS implements threads. You should ensure that any sections of code that use threads are threadsafe and do not interact with any other parts of the code which are NOT known threadsafe! If you really MUST access non-threadsafe code from a Thread, use the Mutex class to wrap access to the code carefully.

Constructor & Destructor Documentation

ThreadEngine::ThreadEngine ( )

Constructor.

ThreadEngine::~ThreadEngine ( )
virtual

Destructor

Member Function Documentation

const std::string ThreadEngine::GetName ( )
inline

Returns the thread engine's name for display purposes

Returns
The thread engine name
const std::string ThreadEngine::GetName ( )
inline

Returns the thread engine's name for display purposes

Returns
The thread engine name
void ThreadEngine::Start ( Thread thread_to_init)

Create a new thread. This takes an already allocated Thread* pointer and initializes it to use this threading engine. On failure, this function may throw a CoreException.

Parameters
thread_to_initPointer to a newly allocated Thread derived object.
void ThreadEngine::Start ( Thread thread_to_init)

Create a new thread. This takes an already allocated Thread* pointer and initializes it to use this threading engine. On failure, this function may throw a CoreException.

Parameters
thread_to_initPointer to a newly allocated Thread derived object.

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