Plasma Engine  2.0
Loading...
Searching...
No Matches
plOSThread Class Reference

Implementation of a thread. More...

#include <OSThread.h>

Inheritance diagram for plOSThread:

Public Member Functions

 plOSThread (plOSThreadEntryPoint threadEntryPoint, void *pUserData=nullptr, plStringView sName="plOSThread", plUInt32 uiStackSize=128 *1024)
 Initializes the thread instance (e.g. thread creation etc.)
 
virtual ~plOSThread ()
 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 plThreadID & GetThreadID () const
 Returns the thread ID of the thread object, may be used in comparison operations with plThreadUtils::GetCurrentThreadID() for example.
 

Static Public Member Functions

static plInt32 GetThreadCount ()
 Returns how many plOSThreads are currently active.
 

Protected Attributes

plThreadHandle m_hHandle
 
plThreadID m_ThreadID
 
plOSThreadEntryPoint m_EntryPoint
 
void * m_pUserData
 
plString m_sName
 
plUInt32 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 plThread class instead as the base for long running threads.

Constructor & Destructor Documentation

◆ plOSThread()

plOSThread::plOSThread ( plOSThreadEntryPoint threadEntryPoint,
void * pUserData = nullptr,
plStringView sName = "plOSThread",
plUInt32 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 plOSThread::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: