64 std::promise<T> promise;
69 promise.set_value(func());
73 promise.set_exception(std::current_exception());
76 return promise.get_future();
81 std::promise<void> promise;
91 promise.set_exception(std::current_exception());
94 return promise.get_future();
static void main_thread_async(std::function< void()> func)
Executes a function on the main thread during message processing.
static std::future< void > main_thread_task(std::function< void()> func)
Definition: run_loop.h:79
static std::future< T > main_thread_task(std::function< T()> func)
Executes a task on the main thread with a future result.
Definition: run_loop.h:62
static void exit()
Signal that message processing should end immediately.
static bool process(int timeout_ms=0)
Process messages for specified amount of time.
Main thread message pump processing.
Definition: run_loop.h:38
static void run()
Continously process messages until RunLoop::exit() is called.