Navigation
API > API/Runtime > API/Runtime/Core
Interface for runnable threads.
This interface specifies the methods used to manage a thread's life cycle.
| Name | FRunnableThread |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/HAL/RunnableThread.h |
| Include Path | #include "HAL/RunnableThread.h" |
Syntax
class FRunnableThread
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FRunnableThread() |
Default constructor. | HAL/RunnableThread.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FRunnableThread() |
Virtual destructor | HAL/RunnableThread.h |
Enums
Public
| Name | Remarks |
|---|---|
| ThreadType | List of unique thread types we can create |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| RunnableTlsSlot | uint32 | Index of TLS slot for FRunnableThread pointer. | HAL/RunnableThread.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const uint32 GetThreadID () |
Thread ID for this thread | HAL/RunnableThread.h | |
const FString & GetThreadName () |
Retrieves the given name of the thread | HAL/RunnableThread.h | |
EThreadPriority GetThreadPriority() |
Returns the runnable's thread priority | HAL/RunnableThread.h | |
virtual FRunnableThread::ThreadType GetThreadType() |
Returns the type of thread this is | HAL/RunnableThread.h | |
bool Kill
(
bool bShouldWait |
Tells the thread to exit. | HAL/RunnableThread.h | |
virtual bool SetThreadAffinity
(
const FThreadAffinity& Affinity |
Changes the thread affinity of the currently running thread | HAL/RunnableThread.h | |
void SetThreadPriority
(
EThreadPriority NewPriority |
Changes the thread priority of the currently running thread | HAL/RunnableThread.h | |
void Suspend
(
bool bShouldPause |
Tells the thread to either pause execution or resume depending on the passed in value. | HAL/RunnableThread.h | |
void WaitForCompletion() |
Halts the caller until this thread is has completed its work. | HAL/RunnableThread.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool CreateInternal
(
FRunnable* InRunnable, |
Creates the thread with the specified stack size and thread priority. | HAL/RunnableThread.h | |
void FreeTls() |
Deletes all FTlsAutoCleanup objects created for this thread. | HAL/RunnableThread.h | |
void SetTls() |
Stores this instance in the runnable thread TLS slot. | HAL/RunnableThread.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FRunnableThread * Create
(
FRunnable* InRunnable, |
Factory method to create a thread with the specified stack size and thread priority. | HAL/RunnableThread.h | |
static FRunnableThread * GetRunnableThread() |
HAL/RunnableThread.h | ||
static uint32 GetTlsSlot() |
Gets a new Tls slot for storing the runnable thread pointer. | HAL/RunnableThread.h | |
static void SetupCreatedThread
(
FRunnableThread*& NewThread, |
Called to setup a newly created RunnableThread | HAL/RunnableThread.h |