ezEngine Release 25.08
Loading...
Searching...
No Matches
ezOSThread Class Reference

Implementation of a thread. More...

#include <OSThread.h>

Inheritance diagram for ezOSThread:

Public Member Functions

 ezOSThread (ezOSThreadEntryPoint threadEntryPoint, void *pUserData=nullptr, ezStringView sName="ezOSThread", ezUInt32 uiStackSize=128 *1024)
 Initializes the thread instance (e.g. thread creation etc.)
 
virtual ~ezOSThread ()
 Destructor.
 
void Start ()
 Starts the thread.
 
void Join ()
 Waits in the calling thread until the thread has finished execution (e.g. returned from the thread function)
 
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_hHandle
 
ezThreadID m_ThreadID
 
ezOSThreadEntryPoint m_EntryPoint
 
void * m_pUserData
 
ezString m_sName
 
ezUInt32 m_uiStackSize
 

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::ezOSThread ( ezOSThreadEntryPoint  threadEntryPoint,
void *  pUserData = nullptr,
ezStringView  sName = "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

◆ Join()

void ezOSThread::Join ( )

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

Joins with the thread (waits for termination)


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