Template Function sixtyfps::invoke_from_event_loop

Function Documentation

template<typename Functor>
void sixtyfps::invoke_from_event_loop(Functor f)

Adds the specified functor to an internal queue, notifies the event loop to wake up. Once woken up, any queued up functors will be invoked. This function is thread-safe and can be called from any thread, including the one running the event loop. The provided functors will only be invoked from the thread that started the event loop.

You can use this to set properties or use any other SixtyFPS APIs from other threads, by collecting the code in a functor and queuing it up for invocation within the event loop.