summaryrefslogtreecommitdiffstats
path: root/cppu/source/threadpool/jobqueue.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/threadpool/jobqueue.cxx')
-rw-r--r--cppu/source/threadpool/jobqueue.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx
index 08640572b678..da525ee006d5 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -122,12 +122,14 @@ namespace cppu_threadpool {
if( job.doRequest )
{
job.doRequest( job.pThreadSpecificData );
+ MutexGuard guard( m_mutex );
m_nToDo --;
}
else
{
- m_nToDo --;
pReturn = job.pThreadSpecificData;
+ MutexGuard guard( m_mutex );
+ m_nToDo --;
break;
}
}
@@ -177,13 +179,13 @@ namespace cppu_threadpool {
}
}
- sal_Bool JobQueue::isEmpty()
+ sal_Bool JobQueue::isEmpty() const
{
MutexGuard guard( m_mutex );
return m_lstJob.empty();
}
- sal_Bool JobQueue::isCallstackEmpty()
+ sal_Bool JobQueue::isCallstackEmpty() const
{
MutexGuard guard( m_mutex );
return m_lstCallstack.empty();
@@ -191,6 +193,7 @@ namespace cppu_threadpool {
sal_Bool JobQueue::isBusy() const
{
+ MutexGuard guard( m_mutex );
return m_nToDo > 0;
}