summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-02-10 16:25:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-02-10 16:26:00 +0100
commitcba3ac1eab7acaf8e6efd7a00eee7c5e969fc49b (patch)
treee5079baf11f7a6e622bd1e32c3a1621b9acb6652 /cppu
parent739100d0abcf6025835028b9d503bf3e11cd77db (diff)
Avoid deadlocks when disposing recursive JobQueue::enter
...where the outer JobQueue::enter blocks on m_cndWait after it has been reset again due to m_lstJob.empty().
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/threadpool/jobqueue.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx
index 47418aff8fa2..08640572b678 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -97,7 +97,9 @@ namespace cppu_threadpool {
if( 0 == m_lstCallstack.front() )
{
// disposed !
- if( m_lstJob.empty() )
+ if( m_lstJob.empty()
+ && (m_lstCallstack.empty()
+ || m_lstCallstack.front() != 0) )
{
osl_resetCondition( m_cndWait );
}
@@ -110,7 +112,8 @@ namespace cppu_threadpool {
job = m_lstJob.front();
m_lstJob.pop_front();
}
- if( m_lstJob.empty() )
+ if( m_lstJob.empty()
+ && (m_lstCallstack.empty() || m_lstCallstack.front() != 0) )
{
osl_resetCondition( m_cndWait );
}