![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Runnable.h>
Inheritance diagram for FRunnable:Public Member Functions | |
| virtual bool | Init () |
| virtual uint32 | Run ()=0 |
| virtual void | Stop () |
| virtual void | Exit () |
| virtual class FSingleThreadRunnable * | GetSingleThreadInterface () |
| virtual | ~FRunnable () |
Interface for "runnable" objects.
A runnable object is an object that is "run" on an arbitrary thread. The call usage pattern is Init(), Run(), Exit(). The thread that is going to "run" this object always uses those calling semantics. It does this on the thread that is created so that any thread specific uses (TLS, etc.) are available in the contexts of those calls. A "runnable" does all initialization in Init().
If initialization fails, the thread stops execution and returns an error code. If it succeeds, Run() is called where the real threaded work is done. Upon completion, Exit() is called to allow correct clean up.
|
inlinevirtual |
Virtual destructor
Exits the runnable object.
Called in the context of the aggregating thread to perform any cleanup.
Reimplemented in FChildWaiterThread, FMultichannelTcpReceiver, FMultichannelTcpSender, FAssetDataGatherer, UE::AssetDataGather::Private::FAssetDataDiscovery, FTaskThreadBase, FInteractiveProcess, FMonitoredProcess, FODSCThread, TcpConsoleListener, FMediaTicker, FMessageRouter, FSlateLoadingThreadTask, FUdpSocketReceiver, FUdpSocketSender, FHttpThreadBase, FUdpPingWorker, FZeroLoad, FPreLoadScreenSlateThreadTask, FRenderingThreadTickHeartbeat, and FRenderingThread.
|
inlinevirtual |
Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. If the interface is not implemented, this runnable will not be ticked when FPlatformProcess::SupportsMultithreading() is false.
Reimplemented in Audio::IAudioMixerPlatformInterface, FTaskThreadBase, FMonitoredProcess, FAsyncWriter, UE::IoStore::FOnDemandHttpThread, FMessageRouter, FUdpSocketReceiver, FUdpSocketSender, and FHttpThreadBase.
Initializes the runnable object.
This method is called in the context of the thread object that aggregates this, not the thread that passes this runnable to a new thread.
Reimplemented in FThreadHeartBeat, FGameThreadHitchHeartBeatThreaded, FAsyncWriter, FAsyncLoadingThread, FChunkCacheWorker, FMultichannelTcpReceiver, FMultichannelTcpSender, FAssetDataGatherer, UE::AssetDataGather::Private::FAssetDataDiscovery, FTaskThreadBase, FInteractiveProcess, FMonitoredProcess, FAsyncLoadingThread2, FODSCThread, FScreenSaverInhibitor, TcpConsoleListener, FMediaTicker, FMessageRouter, FSlateLoadingThreadTask, FUdpSocketReceiver, FUdpSocketSender, FEventLoopHttpThread, FHttpThreadBase, FLegacyHttpThread, FUdpPingWorker, FFileIoStore, FZeroLoad, FPreLoadScreenSlateThreadTask, FStorageServerIoDispatcherBackend, UE::FPlatformIoDispatcherBase, FRenderingThreadTickHeartbeat, and FRenderingThread.
Runs the runnable object.
This is where all per object thread work is done. This is only called if the initialization was successful.
Implemented in FChildWaiterThread, FThreadHeartBeat, FGameThreadHitchHeartBeatThreaded, FAsyncWriter, FAsyncLoadingThread, FShaderCompileThreadRunnableBase, FChunkCacheWorker, FMultichannelTcpReceiver, FMultichannelTcpSender, FAssetDataGatherer, UE::AssetDataGather::Private::FAssetDataDiscovery, Audio::FWasapiCaptureRunnable, Audio::IAudioMixerPlatformInterface, Audio::FMixerNullCallback, FTaskThreadBase, FQueuedThread, TAsyncRunnable< ResultType >, FInteractiveProcess, FMonitoredProcess, FAsyncLoadingThread2, FScreenSaverInhibitor, TcpConsoleListener, FMediaTicker, FMessageRouter, FSlateLoadingThreadTask, FUdpSocketReceiver, FUdpSocketSender, BuildPatchServices::FBuildPatchInstaller, BuildPatchServices::FBuildInstallerThread, FHttpThreadBase, FUdpPingWorker, FFileIoStore, FZeroLoad, FPreLoadScreenSlateThreadTask, FRHIThread, FRHIFrameOffsetThread, FStorageServerIoDispatcherBackend, FStorageServerClientDebugModule, FVulkanThread, Audio::FAudioMixerWasapiRunnable, UE::FPlatformIoDispatcherBase, FODSCThread, FEventLoopHttpThread, FLegacyHttpThread, FRenderingThreadTickHeartbeat, and FRenderingThread.
Stops the runnable object.
This is called if a thread is requested to terminate early.
Reimplemented in FThreadHeartBeat, FGameThreadHitchHeartBeatThreaded, FAsyncWriter, FAsyncLoadingThread, FShaderCompileThreadRunnableBase, FChunkCacheWorker, FMultichannelTcpReceiver, FMultichannelTcpSender, FAssetDataGatherer, UE::AssetDataGather::Private::FAssetDataDiscovery, Audio::FWasapiCaptureRunnable, Audio::FMixerNullCallback, UE::FIoServiceThread, FTaskThreadBase, FInteractiveProcess, FMonitoredProcess, FAsyncLoadingThread2, FODSCThread, FScreenSaverInhibitor, TcpConsoleListener, FMediaTicker, FMessageRouter, FSlateLoadingThreadTask, FUdpSocketReceiver, FUdpSocketSender, BuildPatchServices::FBuildInstallerThread, FHttpThreadBase, FLegacyHttpThread, FUdpPingWorker, FFileIoStore, FZeroLoad, FRHIFrameOffsetThread, FStorageServerIoDispatcherBackend, FStorageServerClientDebugModule, Audio::FAudioMixerWasapiRunnable, UE::FPlatformIoDispatcherBase, and FRenderingThreadTickHeartbeat.