void add_(main_thread_callback::ptr cb)
void main_thread_callback_add(main_thread_callback::ptr ptr)
static void callThis(host_t *host, param_t ¶m)
void add(host_t *host, arg_t const &arg)
pfc::rcptr_t< bool > killswitch_t
entryVoid(host_t *host, killswitch_t ks)
void callback_run()
Gets called from main app thread. See main_thread_callback_manager description for more info...
_callInMainThreadSvc_t(service_t *host, param_t const ¶m)
entry(host_t *host, arg_t const &arg, killswitch_t ks)
void callback_run()
Gets called from main app thread. See main_thread_callback_manager description for more info...
Helper class to call methods of your class (host class) in main thread with convenience. Deals with the otherwise ugly scenario of your class becoming invalid while a method is queued. Have this as a member of your class, then use m_mthelper.add( this, somearg ) ; to defer a call to this->inMainThread(somearg). If your class becomes invalid before inMainThread is executed, the pending callback is discarded. You can optionally call shutdown() to invalidate all pending callbacks early (in a destructor of your class - without waiting for callInMainThreadHelper destructor to do the job. In order to let callInMainThreadHelper access your private methods, declare friend class callInMainThread.
static void callInMainThreadSvc(myservice_t *host, param_t const ¶m)
~callInMainThreadHelper()
service_ptr_t< service_t > m_host
void callback_run()
Gets called from main app thread. See main_thread_callback_manager description for more info...
static void main_thread_callback_spawn()
static void callThis(host_t *host)
Callback object class for main_thread_callback_manager service.