|
| ezTaskWorkerThread (ezWorkerThreadType::Enum threadType, ezUInt32 uiThreadNumber) |
| Tells the worker thread what tasks to execute and which thread index it has.
|
|
ezResult | DeactivateWorker () |
| Deactivates the thread. Returns failure, if the thread is currently still running.
|
|
void | BroadcastClearThreadLocalsEvent () |
| Broadcasts ezThreadEvent::ClearThreadLocals on this thread.
|
|
void | WaitForBroadcastClearTLS () |
|
|
double | GetThreadUtilization (ezUInt32 *pNumTasksExecuted=nullptr) |
| Returns the last utilization value (0 - 1 range). Optionally returns how many tasks it executed recently.
|
|
void | UpdateThreadUtilization (ezTime timePassed) |
| Computes the thread utilization by dividing the thread active time by the time that has passed since the last update.
|
|
|
virtual ezUInt32 | Run () override |
| The run function can be used to implement a long running task in a thread in a platform independent way.
|
|
ezTaskWorkerState | WakeUpIfIdle () |
| If the thread is currently idle, this will wake it up and return EZ_SUCCESS.
|
|
|
enum | ezThreadStatus { Created = 0
, Running
, Finished
} |
| Describes the thread status.
|
|
| ezThread (ezStringView sName="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.
|
|
| 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 const ezThread * | GetCurrentThread () |
| Returns the current ezThread if the current platform thread is an ezThread. Returns nullptr otherwise.
|
|
static ezInt32 | GetThreadCount () |
| Returns how many ezOSThreads are currently active.
|
|
static ezEvent< const ezThreadEvent &, ezMutex > | s_ThreadEvents |
| These events inform about threads starting and finishing.
|
|
ezThreadHandle | m_hHandle |
|
ezThreadID | m_ThreadID |
|
ezOSThreadEntryPoint | m_EntryPoint |
|
void * | m_pUserData |
|
ezString | m_sName |
|
ezUInt32 | m_uiStackSize |
|
◆ Run()
ezUInt32 ezTaskWorkerThread::Run |
( |
| ) |
|
|
overrideprivatevirtual |
The run function can be used to implement a long running task in a thread in a platform independent way.
Implements ezThread.
The documentation for this class was generated from the following files:
- /home/runner/work/ezEngine/ezEngine/Code/Engine/Foundation/Threading/Implementation/TaskWorkerThread.h
- /home/runner/work/ezEngine/ezEngine/Code/Engine/Foundation/Threading/Implementation/TaskWorkerThread.cpp