From c95b3937fef3e2c63768f1b3b1dc2c898f23d91d Mon Sep 17 00:00:00 2001 From: B Stack Date: Wed, 22 Jul 2020 11:37:03 -0400 Subject: add upstream 11.0 --- wx+/async_task.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'wx+/async_task.h') diff --git a/wx+/async_task.h b/wx+/async_task.h index 1599c4d7..47660a6a 100644 --- a/wx+/async_task.h +++ b/wx+/async_task.h @@ -16,18 +16,16 @@ namespace zen { -/* -Run a task in an async thread, but process result in GUI event loop -------------------------------------------------------------------- -1. put AsyncGuiQueue instance inside a dialog: - AsyncGuiQueue guiQueue; +/* Run a task in an async thread, but process result in GUI event loop + ------------------------------------------------------------------- + 1. put AsyncGuiQueue instance inside a dialog: + AsyncGuiQueue guiQueue; -2. schedule async task and synchronous continuation: - guiQueue.processAsync(evalAsync, evalOnGui); + 2. schedule async task and synchronous continuation: + guiQueue.processAsync(evalAsync, evalOnGui); -Alternative: use wxWidgets' inter-thread communication (wxEvtHandler::QueueEvent) https://wiki.wxwidgets.org/Inter-Thread_and_Inter-Process_communication - => don't bother, probably too many MT race conditions lurking around -*/ + Alternative: wxWidgets' inter-thread communication (wxEvtHandler::QueueEvent) https://wiki.wxwidgets.org/Inter-Thread_and_Inter-Process_communication + => don't bother, probably too many MT race conditions lurking around */ namespace impl { @@ -44,7 +42,8 @@ class ConcreteTask : public Task { public: template - ConcreteTask(std::future&& asyncResult, Fun2&& evalOnGui) : asyncResult_(std::move(asyncResult)), evalOnGui_(std::forward(evalOnGui)) {} + ConcreteTask(std::future&& asyncResult, Fun2&& evalOnGui) : + asyncResult_(std::move(asyncResult)), evalOnGui_(std::forward(evalOnGui)) {} bool resultReady () const override { return isReady(asyncResult_); } void evaluateResult() override -- cgit