Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/HAL/Runnable.h |
Include |
#include "HAL/Runnable.h" |
class 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.
Name | Description | |
---|---|---|
|
~FRunnable() |
Virtual destructor |
Name | Description | ||
---|---|---|---|
|
Exit() |
Exits the runnable object. |
|
|
FSingleThrea... |
GetSingleThreadInterface() |
Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. |
|
Init() |
Initializes the runnable object. |
|
|
Run() |
Runs the runnable object. |
|
|
Stop() |
Stops the runnable object. This is called if a thread is requested to terminate early. |