summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-11-04 14:57:39 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-11-04 14:57:39 +0100
commit9bc65c2c93230b799cab85ec29dc3fdd6da855ea (patch)
treeff145a2b26a746634fc2f3da326bb1b78b89f3c2
parentthread-pool: Avoid deadlock when there are no working threads (diff)
downloadcore-feature/perfwork4.tar.gz
core-feature/perfwork4.zip
thread-pool: Fix previous broken commit; This looks better feature/perfwork4
Change-Id: Ieb84adba0b0a9004f025bdb7e57eb01c37d7ce8d
-rw-r--r--comphelper/source/misc/threadpool.cxx6
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;