ezEngine  Milestone 7
ezThread Class Referenceabstract

This class is the base class for platform independent long running threads. More...

#include <Thread.h>

Inheritance diagram for ezThread:

Public Types

enum  ezThreadStatus { Created = 0, Running, Finished }
 Describes the thread status.
 

Public Member Functions

 ezThread (const char *szName="ezThread", ezUInt32 uiStackSize=128 *1024)
 Initializes the runnable class.
 
virtual ~ezThread ()
 Destructor checks if the thread is deleted while still running, which is not allowed as this is a data hazard.
 
ezThreadStatus GetThreadStatus () const
 Returns the thread status.
 
bool IsRunning () const
 Helper function to determine if the thread is running.
 
const char * GetThreadName () const
 Returns the thread name.
 
- Public Member Functions inherited from ezOSThread
 ezOSThread (ezOSThreadEntryPoint pThreadEntryPoint, void *pUserData=nullptr, const char *szName="ezOSThread", ezUInt32 uiStackSize=128 *1024)
 Initializes the thread instance (e.g. thread creation etc.) More...
 
virtual ~ezOSThread ()
 Destructor.
 
void Start ()
 Starts the thread. More...
 
void Join ()
 Waits in the calling thread until the thread has finished execution (e.g. returned from the thread function) More...
 
const ezThreadID & GetThreadID () const
 Returns the thread ID of the thread object, may be used in comparison operations with ezThreadUtils::GetCurrentThreadID() for example.
 

Private Member Functions

virtual ezUInt32 Run ()=0
 The run function can be used to implement a long running task in a thread in a platform independent way.
 

Private Attributes

volatile ezThreadStatus m_ThreadStatus
 
ezThreadLocalPointerTable m_ThreadLocalPointerTable
 
ezString m_Name
 

Friends

ezUInt32 RunThread (ezThread *pThread)
 

Additional Inherited Members

- Static Public Member Functions inherited from ezOSThread
static ezInt32 GetThreadCount ()
 Returns how many ezOSThreads are currently active.
 
- Protected Attributes inherited from ezOSThread
ezThreadHandle m_Handle
 
ezThreadID m_ThreadID
 
ezOSThreadEntryPoint m_EntryPoint
 
void * m_pUserData
 
const char * m_szName
 
ezUInt32 m_uiStackSize
 

Detailed Description

This class is the base class for platform independent long running threads.

Used by deriving from this class and overriding the Run() method.


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