TracktionEngine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
engine::MessageThreadCallback Class Referenceabstract

Calls a function on the message thread checking a calling thread for an exit signal. More...

#include <tracktion_AsyncFunctionUtils.h>

Inheritance diagram for engine::MessageThreadCallback:

Public Member Functions

 MessageThreadCallback ()=default
 
virtual ~MessageThreadCallback ()
 Blocks until any in-flight callback has finished and prevents a pending one from starting, so the message thread can never touch a dangling this.
 
bool hasFinished () const noexcept
 Returns true if the callback has completed.
 
void triggerAndWaitForCallback ()
 Triggers the callback to happen on the message thread and blocks until it has returned or the thread signals it should exit.
 
virtual void performAction ()=0
 

Detailed Description

Calls a function on the message thread checking a calling thread for an exit signal.

Constructor & Destructor Documentation

◆ MessageThreadCallback()

engine::MessageThreadCallback::MessageThreadCallback ( )
default

◆ ~MessageThreadCallback()

virtual engine::MessageThreadCallback::~MessageThreadCallback ( )
virtual

Blocks until any in-flight callback has finished and prevents a pending one from starting, so the message thread can never touch a dangling this.

Member Function Documentation

◆ hasFinished()

bool engine::MessageThreadCallback::hasFinished ( ) const
noexcept

Returns true if the callback has completed.

Referenced by engine::callBlocking().

◆ triggerAndWaitForCallback()

void engine::MessageThreadCallback::triggerAndWaitForCallback ( )

Triggers the callback to happen on the message thread and blocks until it has returned or the thread signals it should exit.

References engine::isCurrentThreadSupplyingExitStatus(), and engine::shouldCurrentThreadExit().

Referenced by engine::callBlocking().

◆ performAction()

virtual void engine::MessageThreadCallback::performAction ( )
pure virtual

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