64 virtual bool Start(
int (*thread_func)(
void*),
const char* name,
void* data) = 0;
72 virtual void Stop() = 0;
78 virtual int WaitForReturn() = 0;
91 virtual int GetId() = 0;
97 virtual Thread* getNew() = 0;
118 virtual bool Init(
int num) = 0;
129 virtual bool WaitAndLock() = 0;
130 virtual bool Unlock() = 0;
155 void clear() { SAFE_DELETE(m_templateThread); SAFE_DELETE(m_templateSemaphore); }
Semaphore()
Definition: Thread.h:110
The MSemaphore class implements a semaphore mechanism based on SDL for use with MThread.
Definition: Thread.h:107
void setTemplateSemaphore(Semaphore *sem)
Sets the semaphore template object with the overwritten getNew method.
Definition: Thread.h:167
virtual Thread * getNew()=0
Creates a new thread object. Should be overwritten by child classes.
~Semaphore()
Definition: Thread.h:111
Thread()
Definition: Thread.h:42
void clear()
Deletes all templates.
Definition: Thread.h:155
The MThread class implements a multithreading mechanism.
Definition: Thread.h:37
virtual Semaphore * getNew()=0
Creates a new semaphore object.
Semaphore * getNewSemaphore()
Creates a new semaphore.
Definition: Thread.h:179
void SetRunning(bool value)
Definition: Thread.h:85
Thread * getNewThread()
Creates a new thread.
Definition: Thread.h:173
~Thread()
The destructor calls MThread::Stop to clean up.
Definition: Thread.h:47
bool IsRunning()
IsRunning Returns if the thread is currently running.
Definition: Thread.h:84
void setTemplateThread(Thread *thr)
Sets the thread template object with the overwritten getNew method.
Definition: Thread.h:161
The ThreadFactory class allows you to register any subclass of Thread and Semaphore to provide the im...
Definition: Thread.h:144