diff options
author | B Stack <bgstack15@gmail.com> | 2020-07-22 16:56:03 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-07-22 16:56:03 +0000 |
commit | e5633fb1c0db91f01ab967330b76baf4ecdb0512 (patch) | |
tree | 10260e25ae905564f7978b83fc4e316670f987c6 /wx+/async_task.h | |
parent | Merge branch '10.25' into 'master' (diff) | |
parent | add upstream 11.0 (diff) | |
download | FreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.tar.gz FreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.tar.bz2 FreeFileSync-e5633fb1c0db91f01ab967330b76baf4ecdb0512.zip |
Merge branch '11.0' into 'master'11.0
add upstream 11.0
See merge request opensource-tracking/FreeFileSync!24
Diffstat (limited to 'wx+/async_task.h')
-rw-r--r-- | wx+/async_task.h | 21 |
1 files changed, 10 insertions, 11 deletions
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 <class Fun2> - ConcreteTask(std::future<ResultType>&& asyncResult, Fun2&& evalOnGui) : asyncResult_(std::move(asyncResult)), evalOnGui_(std::forward<Fun2>(evalOnGui)) {} + ConcreteTask(std::future<ResultType>&& asyncResult, Fun2&& evalOnGui) : + asyncResult_(std::move(asyncResult)), evalOnGui_(std::forward<Fun2>(evalOnGui)) {} bool resultReady () const override { return isReady(asyncResult_); } void evaluateResult() override |