ThreadClass Class Reference

#include <ThreadClass.h>

Inheritance diagram for ThreadClass:

Inheritance graph
[legend]
Collaboration diagram for ThreadClass:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ThreadClass ()
virtual ~ThreadClass ()
void Sleep (int milliseconds)

Protected Member Functions

void DoQuitNow (const int returnCode)
virtual int ThreadEntry (void)=0
virtual void ThreadExiting (const int returnCode)
void CheckQuit (void)

Friends

class Thread


Detailed Description

This is a class that the thread manager can thread with. Entry for a thread starts at ThreadEntry.

Constructor & Destructor Documentation

ThreadClass (  ) 

The ctor performs some basic initialisation

virtual ~ThreadClass (  )  [virtual]

The dtor makes sure everything is tidy


Member Function Documentation

void Sleep ( int  milliseconds  ) 

Sleeps the thread for the class by the number of milliseconds supplied. This uses the CurrentThreadSleep() function. Internally this is a point where the thread can be cancelled. There must not be any mutex object with a current lock when Sleep() is called otherwise a deadlock situation may develop. Memory should not be allocated on the heap at this point unless it can be freed by ThreadExiting() or the class dtor.

Parameters:
milliseconds the sleep time in milliseconds

void DoQuitNow ( const int  returnCode  )  [protected]

This exits the thread and can only be used in the context of the thread.

Parameters:
returnCode The return code.

virtual int ThreadEntry ( void   )  [protected, pure virtual]

The thread starts executing from here.

Implemented in BaseServer, and BaseTransportServer.

virtual void ThreadExiting ( const int  returnCode  )  [protected, virtual]

This is called just before the thread exits, from the context of the thread.

void CheckQuit ( void   )  [protected]

If Thread::Terminate() has been called then using this function will exit the thread.


Generated on Sat Jun 28 22:02:25 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3