![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
Inheritance diagram for FTaskThreadBase:Public Member Functions | |
| FTaskThreadBase () | |
| void | Setup (ENamedThreads::Type InThreadId, uint32 InPerThreadIDTLSSlot, FWorkerThread *InOwnerWorker) |
| void | InitializeForCurrentThread () |
| ENamedThreads::Type | GetThreadId () const |
| virtual void | ProcessTasksUntilQuit (int32 QueueIndex)=0 |
| virtual uint64 | ProcessTasksUntilIdle (int32 QueueIndex) |
| virtual void | EnqueueFromThisThread (int32 QueueIndex, FBaseGraphTask *Task) |
| virtual void | RequestQuit (int32 QueueIndex)=0 |
| virtual bool | EnqueueFromOtherThread (int32 QueueIndex, FBaseGraphTask *Task) |
| virtual void | WakeUp (int32 QueueIndex=0)=0 |
| virtual bool | IsProcessingTasks (int32 QueueIndex)=0 |
| virtual void | Tick () override |
| virtual bool | Init () override |
| virtual uint32 | Run () override |
| virtual void | Stop () override |
| virtual void | Exit () override |
| virtual FSingleThreadRunnable * | GetSingleThreadInterface () override |
Public Member Functions inherited from FRunnable | |
| virtual | ~FRunnable () |
Protected Attributes | |
| ENamedThreads::Type | ThreadId |
| uint32 | PerThreadIDTLSSlot |
| FThreadSafeCounter | IsStalled |
| TArray< FBaseGraphTask * > | NewTasks |
| FWorkerThread * | OwnerWorker |
FTaskThreadBase Base class for a thread that executes tasks This class implements the FRunnable API, but external threads don't use that because those threads are created elsewhere.
|
inline |
Constructor, initializes everything to unusable values. Meant to be called from a "main" thread.
|
inlinevirtual |
Queue a task, assuming that this thread is not the same as the current thread.
| QueueIndex,Queue | to enqueue into |
| Task; | Task to queue. |
Reimplemented in FNamedTaskThread.
|
inlinevirtual |
Queue a task, assuming that this thread is the same as the current thread. For named threads, these go directly into the private queue.
| QueueIndex,Queue | to enqueue for |
| Task | Task to queue. |
Reimplemented in FNamedTaskThread.
Called in the context of the aggregating thread to perform any cleanup.
Reimplemented from FRunnable.
|
inlineoverridevirtual |
Return single threaded interface when multithreading is disabled.
Reimplemented from FRunnable.
|
inline |
Return the index of this thread.
Allows per runnable object initialization. NOTE: This is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.
Reimplemented from FRunnable.
|
inline |
A one-time call to set the TLS entry for this thread.
Return true if this thread is processing tasks. This is only a "guess" if you ask for a thread other than yourself because that can change before the function returns.
| QueueIndex,Queue | to request quit from |
Implemented in FNamedTaskThread, and FTaskThreadAnyThread.
Used for named threads to start processing tasks until the thread is idle and RequestQuit has been called.
Reimplemented in FNamedTaskThread, and FTaskThreadAnyThread.
Used for named threads to start processing tasks until the thread is idle and RequestQuit has been called.
Implemented in FNamedTaskThread, and FTaskThreadAnyThread.
Will cause the thread to return to the caller when it becomes idle. Used to return from ProcessTasksUntilQuit for named threads or to shut down unnamed threads. CAUTION: This will not work under arbitrary circumstances. For example you should not attempt to stop unnamed threads unless they are known to be idle. Return requests for named threads should be submitted from that named thread as FReturnGraphTask does.
| QueueIndex,Queue | to request quit from |
Implemented in FNamedTaskThread, and FTaskThreadAnyThread.
This is where all per object thread work is done. This is only called if the initialization was successful.
Implements FRunnable.
|
inline |
Sets up some basic information for a thread. Meant to be called from a "main" thread. Also creates the stall event.
| InThreadId; | Thread index for this thread. |
| InPerThreadIDTLSSlot; | TLS slot to store the pointer to me into (later) |
This is called if a thread is requested to terminate early
Reimplemented from FRunnable.
Tick single-threaded.
Implements FSingleThreadRunnable.
Implemented in FNamedTaskThread, and FTaskThreadAnyThread.
|
protected |
Used to signal stalling. Not safe for synchronization in most cases.
|
protected |
Array of tasks for this task thread.
|
protected |
back pointer to the owning FWorkerThread
|
protected |
TLS SLot that we store the FTaskThread* this pointer in.
|
protected |
Id / Index of this thread.