summaryrefslogtreecommitdiff
path: root/include/comphelper/threadpool.hxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-10-31 12:32:12 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-10-31 18:13:05 +0000
commit68f912e896b14546f17ef8bd090f08229842519f (patch)
treeb900d366e72a32c4dad31014d5aa222137cee710 /include/comphelper/threadpool.hxx
parentfc9e78f4498a3b44be72e13c0c64d235f62b8a99 (diff)
thread-pool: fix waiting until all tasks are complete.
Change-Id: Iaf5a3bf28879f229a223a8760fd878f96958a53c
Diffstat (limited to 'include/comphelper/threadpool.hxx')
-rw-r--r--include/comphelper/threadpool.hxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/comphelper/threadpool.hxx b/include/comphelper/threadpool.hxx
index 2e5171902f55..231a735d9107 100644
--- a/include/comphelper/threadpool.hxx
+++ b/include/comphelper/threadpool.hxx
@@ -54,10 +54,14 @@ private:
ThreadTask *waitForWork( osl::Condition &rNewWork );
ThreadTask *popWork();
+ void startWork();
+ void stopWork();
- osl::Mutex maGuard;
- osl::Condition maTasksEmpty;
- bool mbTerminate;
+ osl::Mutex maGuard;
+ sal_Int32 mnThreadsWorking;
+ /// signalled when all in-progress tasks are complete
+ osl::Condition maTasksComplete;
+ bool mbTerminate;
std::vector< rtl::Reference< ThreadWorker > > maWorkers;
std::vector< ThreadTask * > maTasks;
};