summaryrefslogtreecommitdiff
path: root/cppu/source/threadpool/thread.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-04-19 12:49:08 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-04-19 12:49:08 +0000
commitbeeba4adcdd2f91d032e689da49b8c32eb6433ce (patch)
tree61ddc255ae9e5407e09320dc4a0c8ff907503d1b /cppu/source/threadpool/thread.cxx
parentd675aab65dec6494400c3b0d1864dc1e04ad1b10 (diff)
INTEGRATION: CWS sb49 (1.7.38); FILE MERGED
2006/03/22 10:14:05 sb 1.7.38.1: #i63397# Keep objects alive long enough so that threads still running while atexit handlers are processed do not access dead objects.
Diffstat (limited to 'cppu/source/threadpool/thread.cxx')
-rw-r--r--cppu/source/threadpool/thread.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx
index 924a7126fa5e..caf6910d1cae 100644
--- a/cppu/source/threadpool/thread.cxx
+++ b/cppu/source/threadpool/thread.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: thread.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: rt $ $Date: 2005-09-08 08:47:03 $
+ * last change: $Author: hr $ $Date: 2006-04-19 13:49:08 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -120,10 +120,13 @@ namespace cppu_threadpool {
}
// ----------------------------------------------------------------------------------
- ORequestThread::ORequestThread( JobQueue *pQueue,
- const ByteSequence &aThreadId,
- sal_Bool bAsynchron )
+ ORequestThread::ORequestThread(
+ rtl::Reference< ThreadPool > const & threadPool,
+ JobQueue *pQueue,
+ const ByteSequence &aThreadId,
+ sal_Bool bAsynchron )
: m_thread( 0 )
+ , m_threadPool( threadPool )
, m_pQueue( pQueue )
, m_aThreadId( aThreadId )
, m_bAsynchron( bAsynchron )
@@ -193,11 +196,13 @@ namespace cppu_threadpool {
// Note : Oneways should not get a disposable disposeid,
// It does not make sense to dispose a call in this state.
// That's way we put it an disposeid, that can't be used otherwise.
- m_pQueue->enter( (sal_Int64 ) this , sal_True );
+ m_pQueue->enter(
+ m_threadPool->m_disposedCallerAdmin, (sal_Int64 ) this,
+ sal_True );
if( m_pQueue->isEmpty() )
{
- ThreadPool::getInstance()->revokeQueue( m_aThreadId , m_bAsynchron );
+ m_threadPool->revokeQueue( m_aThreadId , m_bAsynchron );
// Note : revokeQueue might have failed because m_pQueue.isEmpty()
// may be false (race).
}
@@ -211,7 +216,7 @@ namespace cppu_threadpool {
uno_releaseIdFromCurrentThread();
}
- cppu_threadpool::ThreadPool::getInstance()->waitInPool( this );
+ m_threadPool->waitInPool( this );
}
}
}