3#include <Foundation/Basics.h>
4#include <Foundation/Communication/Event.h>
5#include <Foundation/Strings/String.h>
6#include <Foundation/Threading/ThreadUtils.h>
8#include <Foundation/Threading/Implementation/OSThread.h>
14PL_WARNING_DISABLE_MSVC(4355)
16#ifndef PL_THREAD_CLASS_ENTRY_POINT
17# error "Definition for plThreadClassEntryPoint is missing on this platform!"
20PL_THREAD_CLASS_ENTRY_POINT;
43 static const plThread* GetCurrentThread();
63 inline bool IsRunning()
const {
return m_ThreadStatus == Running; }
76 virtual plUInt32
Run() = 0;
83 friend plUInt32 RunThread(
plThread* pThread);
Implementation of a thread.
Definition OSThread.h:13
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
This class is the base class for platform independent long running threads.
Definition Thread.h:40
static plEvent< const plThreadEvent &, plMutex > s_ThreadEvents
These events inform about threads starting and finishing.
Definition Thread.h:72
bool IsRunning() const
Helper function to determine if the thread is running.
Definition Thread.h:63
plThreadStatus GetThreadStatus() const
Returns the thread status.
Definition Thread.h:60
plThreadStatus
Describes the thread status.
Definition Thread.h:47
virtual plUInt32 Run()=0
The run function can be used to implement a long running task in a thread in a platform independent w...
const char * GetThreadName() const
Returns the thread name.
Definition Thread.h:66
Type
Definition Thread.h:25
@ StartingExecution
Called on the thread that executes the plThread instance.
@ ThreadCreated
Called on the thread that creates the plThread instance.
@ FinishedExecution
Called on the thread that executes the plThread instance.
@ ThreadDestroyed
Called on the thread that destroys the plThread instance.