This class is a dispatcher for methods that are being called by either the message thread or the sample loading thread. More...
Inherits Timer.
Public Member Functions | |
bool | callOnMessageThreadAfterSuspension (Dispatchable *object, const Dispatchable::Function &f) |
This method executes the function with the given DispatchableBaseObject. More... | |
This class is a dispatcher for methods that are being called by either the message thread or the sample loading thread.
The general philosophy is that the loading thread functions always have the priority. In order to enforce this method, you need to check regularly in your message thread's function if it should abort and return false so it will get called again.
If you can' acquire the lock in your sample loading function, call signalAbort and return false, so it will try to repeat calling the method after a short time (usually 50 ms)
bool callOnMessageThreadAfterSuspension | ( | Dispatchable * | object, |
const Dispatchable::Function & | f | ||
) |
This method executes the function with the given DispatchableBaseObject.
It will call it synchronously if its on the message thread and there's no abort signal from a pending global lock.
If it needs to be called asynchronously, it will be added to the internal queue. In your method you should need to regularly check if the operation should abort and return DispatchableObject::Status::needsToRunAgain