engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FRunnable类 参考abstract

Interface for "runnable" objects. 更多...

#include <Runnable.h>

+ 类 FRunnable 继承关系图:

Public 成员函数

virtual void Exit ()
 Exits the runnable object. 更多...
 
virtual class FSingleThreadRunnable * GetSingleThreadInterface ()
 Gets single thread interface pointer used for ticking this runnable when multi-threading is disabled. 更多...
 
virtual bool Init ()
 Initializes the runnable object. 更多...
 
virtual uint32 Run ()=0
 Runs the runnable object. 更多...
 
virtual void Stop ()
 Stops the runnable object. 更多...
 
virtual ~FRunnable ()
 Virtual destructor
 

详细描述

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.

成员函数说明

◆ Exit()

virtual void FRunnable::Exit ( )
inlinevirtual

Exits the runnable object.

Called in the context of the aggregating thread to perform any cleanup.

参见
Init, Run, Stop

被 FMultichannelTcpReceiver, FMultichannelTcpSender, FInteractiveProcess, FMonitoredProcess, FUdpSocketReceiver, FUdpSocketSender , 以及 FPreLoadScreenSlateThreadTask 重载.

◆ 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.

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

被 Audio::IAudioMixerPlatformInterface, FMonitoredProcess, FUdpSocketReceiver , 以及 FUdpSocketSender 重载.

◆ Init()

virtual bool FRunnable::Init ( )
inlinevirtual

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.

返回
True if initialization was successful, false otherwise
参见
Run, Stop, Exit

被 FThreadHeartBeat, FAsyncWriter, FMultichannelTcpReceiver, FMultichannelTcpSender, FInteractiveProcess, FMonitoredProcess, FUdpSocketReceiver, FUdpSocketSender , 以及 FPreLoadScreenSlateThreadTask 重载.

◆ Run()

virtual uint32 FRunnable::Run ( )
pure virtual

Runs the runnable object.

This is where all per object thread work is done. This is only called if the initialization was successful.

返回
The exit code of the runnable object
参见
Init, Stop, Exit

在 FThreadHeartBeat, FAsyncWriter, FMultichannelTcpReceiver, FMultichannelTcpSender, Audio::IAudioMixerPlatformInterface, Audio::FMixerNullCallback, TAsyncRunnable< ResultType >, FInteractiveProcess, FMonitoredProcess, FUdpSocketReceiver, FUdpSocketSender , 以及 FPreLoadScreenSlateThreadTask 内被实现.

◆ Stop()

virtual void FRunnable::Stop ( )
inlinevirtual

Stops the runnable object.

This is called if a thread is requested to terminate early.

参见
Init, Run, Exit

被 FThreadHeartBeat, FAsyncWriter, FMultichannelTcpReceiver, FMultichannelTcpSender, FInteractiveProcess, FMonitoredProcess, FUdpSocketReceiver , 以及 FUdpSocketSender 重载.


该类的文档由以下文件生成: