UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRunnable Class Referenceabstract

#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 FSingleThreadRunnableGetSingleThreadInterface ()
 
virtual ~FRunnable ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~FRunnable()

virtual FRunnable::~FRunnable ( )
inlinevirtual

Virtual destructor

Member Function Documentation

◆ Exit()

◆ GetSingleThreadInterface()

virtual class FSingleThreadRunnable * FRunnable::GetSingleThreadInterface ( )
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.

Returns
Pointer to the single thread interface or nullptr if not implemented.

Reimplemented in Audio::IAudioMixerPlatformInterface, FTaskThreadBase, FMonitoredProcess, FAsyncWriter, UE::IoStore::FOnDemandHttpThread, FMessageRouter, FUdpSocketReceiver, FUdpSocketSender, and FHttpThreadBase.

◆ Init()

◆ Run()

◆ Stop()


The documentation for this class was generated from the following file: