diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-04 14:57:39 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-11-04 14:57:39 +0100 |
commit | 9bc65c2c93230b799cab85ec29dc3fdd6da855ea (patch) | |
tree | ff145a2b26a746634fc2f3da326bb1b78b89f3c2 | |
parent | 2ac7d5038806b017c8dc062c1ba29930649cc3db (diff) |
thread-pool: Fix previous broken commit; This looks better
feature/perfwork4
Change-Id: Ieb84adba0b0a9004f025bdb7e57eb01c37d7ce8d
-rw-r--r-- | comphelper/source/misc/threadpool.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index 39c4e73fa3e7..77e9962c6e9c 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -99,7 +99,7 @@ ThreadPool::ThreadPool( sal_Int32 nWorkers ) : for( sal_Int32 i = 0; i < nWorkers; i++ ) maWorkers.push_back( new ThreadWorker( this ) ); - maTasksComplete.reset(); + maTasksComplete.set(); osl::MutexGuard aGuard( maGuard ); for( size_t i = 0; i < maWorkers.size(); i++ ) @@ -187,10 +187,6 @@ void ThreadPool::waitUntilEmpty() { osl::ResettableMutexGuard aGuard( maGuard ); - // Avoid deadlock when there are no working threads - if( maTasks.empty() ) - return; - if( maWorkers.empty() ) { // no threads at all -> execute the work in-line ThreadTask *pTask; |