From a48439992d4b1c896dd0beaff91d0a14361032b9 Mon Sep 17 00:00:00 2001 From: B Stack Date: Sun, 10 Feb 2019 16:47:23 -0500 Subject: 10.9 --- wx+/async_task.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100755 => 100644 wx+/async_task.h (limited to 'wx+/async_task.h') diff --git a/wx+/async_task.h b/wx+/async_task.h old mode 100755 new mode 100644 index 074f5337..04eac61c --- a/wx+/async_task.h +++ b/wx+/async_task.h @@ -115,7 +115,7 @@ private: class AsyncGuiQueue : private wxEvtHandler { public: - AsyncGuiQueue() { timer_.Connect(wxEVT_TIMER, wxEventHandler(AsyncGuiQueue::onTimerEvent), nullptr, this); } + AsyncGuiQueue(int pollingMs = 50) : pollingMs_(pollingMs) { timer_.Connect(wxEVT_TIMER, wxEventHandler(AsyncGuiQueue::onTimerEvent), nullptr, this); } template void processAsync(Fun&& evalAsync, Fun2&& evalOnGui) @@ -123,7 +123,7 @@ public: asyncTasks_.add(std::forward(evalAsync), std::forward(evalOnGui)); if (!timer_.IsRunning()) - timer_.Start(50 /*unit: [ms]*/); + timer_.Start(pollingMs_ /*unit: [ms]*/); } private: @@ -134,6 +134,7 @@ private: timer_.Stop(); } + const int pollingMs_; impl::AsyncTasks asyncTasks_; wxTimer timer_; //don't use wxWidgets' idle handling => repeated idle requests/consumption hogs 100% cpu! }; -- cgit