ezEngine  Milestone 7
ezOSThread Class Reference

Implementation of a thread. More...

#include <OSThread.h>

Inheritance diagram for ezOSThread:

Public Member Functions

 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 ()
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.

Static Public Member Functions

static ezInt32 GetThreadCount ()
 Returns how many ezOSThreads are currently active.

Protected Attributes

ezThreadHandle m_Handle
ezThreadID m_ThreadID
ezOSThreadEntryPoint m_EntryPoint
void * m_pUserData
const char * m_szName
ezUInt32 m_uiStackSize

Private Member Functions


Static Private Attributes

static ezAtomicInteger32 s_iThreadCount
 Stores how many ezOSThread are currently active.

Detailed Description

Implementation of a thread.

Since the thread class needs a platform specific entry-point it is usually recommended to use the ezThread class instead as the base for long running threads.

Constructor & Destructor Documentation

ezOSThread::ezOSThread ( ezOSThreadEntryPoint  pThreadEntryPoint,
void *  pUserData = nullptr,
const char *  szName = "ezOSThread",
ezUInt32  uiStackSize = 128 * 1024 

Initializes the thread instance (e.g. thread creation etc.)

Note that the thread won't start execution until Start() is called. Please note that szName must be valid until Start() has been called!

Member Function Documentation

void ezOSThread::Join ( )

Waits in the calling thread until the thread has finished execution (e.g. returned from the thread function)

Releases a lock that has been previously acquired.

Joins with the thread (waits for termination)

void ezOSThread::Start ( )

Starts the thread.

Attempts to acquire an exclusive lock for this mutex object.

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