Ark Server API (ASA) - Wiki
|
#include <Runnable.h>
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.
Definition at line 19 of file Runnable.h.
|
inlinevirtual |
Virtual destructor
Definition at line 75 of file Runnable.h.
Exits the runnable object.
Called in the context of the aggregating thread to perform any cleanup.
Reimplemented in FInteractiveProcess, and FMonitoredProcess.
Definition at line 61 of file Runnable.h.
|
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 FMonitoredProcess, and FAsyncWriter.
Definition at line 69 of file Runnable.h.
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, FInteractiveProcess, and FMonitoredProcess.
Definition at line 32 of file Runnable.h.
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 FThreadHeartBeat, FGameThreadHitchHeartBeatThreaded, FAsyncWriter, FInteractiveProcess, and FMonitoredProcess.
Stops the runnable object.
This is called if a thread is requested to terminate early.
Reimplemented in FThreadHeartBeat, FGameThreadHitchHeartBeatThreaded, FAsyncWriter, FInteractiveProcess, and FMonitoredProcess.
Definition at line 53 of file Runnable.h.