ReplicaNet and RNLobby
1
|
#include <ThreadClass.h>
Public Member Functions | |
ThreadClass () | |
virtual | ~ThreadClass () |
void | Sleep (int milliseconds) |
![]() | |
MutexClass () | |
virtual | ~MutexClass () |
void | Lock (void) |
void | UnLock (void) |
Protected Member Functions | |
void | DoQuitNow (const int returnCode) |
virtual int | ThreadEntry (void)=0 |
virtual void | ThreadExiting (const int returnCode) |
void | CheckQuit (void) |
Static Protected Member Functions | |
static size_t | GetNumAllocated (void) |
Friends | |
class | Thread |
Additional Inherited Members | |
![]() | |
enum | { kNoOwnerThread = -1 } |
This is a class that the thread manager can thread with. Entry for a thread starts at ThreadEntry.
ThreadClass | ( | ) |
The ctor performs some basic initialisation
|
virtual |
The dtor makes sure everything is tidy
|
protected |
If Thread::Terminate() has been called then using this function will exit the thread.
|
protected |
This exits the thread and can only be used in the context of the thread.
returnCode | The return code. |
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 by Thread::Terminate(). The thread must not have 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.
milliseconds | the sleep time in milliseconds |
|
protectedpure virtual |
The thread starts executing from here.
Implemented in AdvertiseClient::PingServer, BaseTransportServer, ASyncUpdateCheck, Worker, BaseServer, and Security.
|
protectedvirtual |
This is called just before the thread exits, from the context of the thread.
Reimplemented in Worker.