summaryrefslogtreecommitdiff
path: root/cppu/source/threadpool
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/threadpool')
-rw-r--r--cppu/source/threadpool/current.cxx32
-rw-r--r--cppu/source/threadpool/jobqueue.cxx6
-rw-r--r--cppu/source/threadpool/thread.cxx2
-rw-r--r--cppu/source/threadpool/threadident.cxx2
-rw-r--r--cppu/source/threadpool/threadpool.cxx22
5 files changed, 32 insertions, 32 deletions
diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx
index cc313cdf925a..084e82b2f07f 100644
--- a/cppu/source/threadpool/current.cxx
+++ b/cppu/source/threadpool/current.cxx
@@ -42,15 +42,15 @@ namespace cppu
static typelib_InterfaceTypeDescription * get_type_XCurrentContext()
{
- static typelib_InterfaceTypeDescription * s_type_XCurrentContext = 0;
- if (0 == s_type_XCurrentContext)
+ static typelib_InterfaceTypeDescription * s_type_XCurrentContext = nullptr;
+ if (nullptr == s_type_XCurrentContext)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (0 == s_type_XCurrentContext)
+ if (nullptr == s_type_XCurrentContext)
{
OUString sTypeName("com.sun.star.uno.XCurrentContext");
- typelib_InterfaceTypeDescription * pTD = 0;
- typelib_TypeDescriptionReference * pMembers[1] = { 0 };
+ typelib_InterfaceTypeDescription * pTD = nullptr;
+ typelib_TypeDescriptionReference * pMembers[1] = { nullptr };
OUString sMethodName0("com.sun.star.uno.XCurrentContext::getValueByName");
typelib_typedescriptionreference_new(
&pMembers[0],
@@ -66,7 +66,7 @@ static typelib_InterfaceTypeDescription * get_type_XCurrentContext()
typelib_typedescription_register( reinterpret_cast<typelib_TypeDescription**>(&pTD) );
typelib_typedescriptionreference_release( pMembers[0] );
- typelib_InterfaceMethodTypeDescription * pMethod = 0;
+ typelib_InterfaceMethodTypeDescription * pMethod = nullptr;
typelib_Parameter_Init aParameters[1];
OUString sParamName0("Name");
OUString sParamType0("string");
@@ -122,7 +122,7 @@ public:
explicit ThreadKey( oslThreadKeyCallbackFunction pCallback )
: _bInit(false)
- , _hThreadKey(0)
+ , _hThreadKey(nullptr)
, _pCallback(pCallback)
{
}
@@ -166,8 +166,8 @@ IdContainer * getIdContainer()
if (! pId)
{
pId = new IdContainer();
- pId->pCurrentContext = 0;
- pId->pCurrentContextEnv = 0;
+ pId->pCurrentContext = nullptr;
+ pId->pCurrentContextEnv = nullptr;
pId->bInit = false;
::osl_setThreadKeyData( aKey, pId );
}
@@ -192,14 +192,14 @@ extern "C" sal_Bool SAL_CALL uno_setCurrentContext(
pId->pCurrentContextEnv, pId->pCurrentContext );
(*pId->pCurrentContextEnv->aBase.release)(
&pId->pCurrentContextEnv->aBase );
- pId->pCurrentContextEnv = 0;
+ pId->pCurrentContextEnv = nullptr;
- pId->pCurrentContext = 0;
+ pId->pCurrentContext = nullptr;
}
if (pCurrentContext)
{
- uno_Environment * pEnv = 0;
+ uno_Environment * pEnv = nullptr;
::uno_getEnvironment( &pEnv, pEnvTypeName, pEnvContext );
OSL_ASSERT( pEnv && pEnv->pExtEnv );
if (pEnv)
@@ -242,16 +242,16 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext(
if (! target_env.is())
return sal_False;
uno_ExtEnvironment * pEnv = target_env.get()->pExtEnv;
- OSL_ASSERT( 0 != pEnv );
- if (0 == pEnv)
+ OSL_ASSERT( nullptr != pEnv );
+ if (nullptr == pEnv)
return sal_False;
(*pEnv->releaseInterface)( pEnv, *ppCurrentContext );
- *ppCurrentContext = 0;
+ *ppCurrentContext = nullptr;
}
// case: null-ref
- if (0 == pId->pCurrentContext)
+ if (nullptr == pId->pCurrentContext)
return sal_True;
if (! target_env.is())
diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx
index c0fdd6249383..094a55ef9372 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -47,13 +47,13 @@ namespace cppu_threadpool {
void *JobQueue::enter( sal_Int64 nDisposeId , bool bReturnWhenNoJob )
{
- void *pReturn = 0;
+ void *pReturn = nullptr;
{
// synchronize with the dispose calls
MutexGuard guard( m_mutex );
if( m_DisposedCallerAdmin->isDisposed( nDisposeId ) )
{
- return 0;
+ return nullptr;
}
m_lstCallstack.push_front( nDisposeId );
}
@@ -72,7 +72,7 @@ namespace cppu_threadpool {
m_cndWait.wait();
- struct Job job={0,0};
+ struct Job job={nullptr,nullptr};
{
// synchronize with add and dispose calls
MutexGuard guard( m_mutex );
diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx
index ead78c3080f1..3b95c8d5d5bb 100644
--- a/cppu/source/threadpool/thread.cxx
+++ b/cppu/source/threadpool/thread.cxx
@@ -180,7 +180,7 @@ namespace cppu_threadpool {
}
delete m_pQueue;
- m_pQueue = 0;
+ m_pQueue = nullptr;
if( ! m_bAsynchron )
{
diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx
index dcf6d1fe9475..87daa491342c 100644
--- a/cppu/source/threadpool/threadident.cxx
+++ b/cppu/source/threadpool/threadident.cxx
@@ -100,7 +100,7 @@ extern "C" sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId
IdContainer *p = getIdContainer();
if( ! p->bInit )
{
- p->pLocalThreadId = 0;
+ p->pLocalThreadId = nullptr;
createLocalId( &(p->pLocalThreadId) );
p->nRefCountOfCurrentId = 1;
p->pCurrentId = pThreadId;
diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx
index 9868d0cd64b5..42a4ff0ff8a5 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -193,7 +193,7 @@ namespace cppu_threadpool
// inform the thread and let it go
struct WaitingThread *pWaitingThread = m_lstThreads.back();
pWaitingThread->thread->setTask( pQueue , aThreadId , bAsynchron );
- pWaitingThread->thread = 0;
+ pWaitingThread->thread = nullptr;
// remove from list
m_lstThreads.pop_back();
@@ -224,7 +224,7 @@ namespace cppu_threadpool
return false;
}
- (*ii).second.second = 0;
+ (*ii).second.second = nullptr;
if( (*ii).second.first )
{
// all oneway request have been processed, now
@@ -239,10 +239,10 @@ namespace cppu_threadpool
// another thread has put something into the queue
return false;
}
- (*ii).second.first = 0;
+ (*ii).second.first = nullptr;
}
- if( 0 == (*ii).second.first && 0 == (*ii).second.second )
+ if( nullptr == (*ii).second.first && nullptr == (*ii).second.second )
{
m_mapQueue.erase( ii );
}
@@ -258,7 +258,7 @@ namespace cppu_threadpool
RequestFun * doRequest )
{
bool bCreateThread = false;
- JobQueue *pQueue = 0;
+ JobQueue *pQueue = nullptr;
{
MutexGuard guard( m_mutex );
@@ -311,7 +311,7 @@ namespace cppu_threadpool
JobQueue *p = new JobQueue();
m_mapQueue[ aThreadId ] = pair< JobQueue * , JobQueue * > ( p , nullptr );
}
- else if( 0 == (*ii).second.first )
+ else if( nullptr == (*ii).second.first )
{
(*ii).second.first = new JobQueue();
}
@@ -319,7 +319,7 @@ namespace cppu_threadpool
void * ThreadPool::enter( const ByteSequence & aThreadId , sal_Int64 nDisposeId )
{
- JobQueue *pQueue = 0;
+ JobQueue *pQueue = nullptr;
{
MutexGuard guard( m_mutex );
@@ -385,7 +385,7 @@ namespace {
ThreadPoolHolder getThreadPool( uno_ThreadPool hPool )
{
MutexGuard guard( Mutex::getGlobalMutex() );
- assert( g_pThreadpoolHashSet != 0 );
+ assert( g_pThreadpoolHashSet != nullptr );
ThreadpoolHashSet::iterator i( g_pThreadpoolHashSet->find(hPool) );
assert( i != g_pThreadpoolHashSet->end() );
return i->second;
@@ -418,7 +418,7 @@ uno_threadpool_create() SAL_THROW_EXTERN_C()
extern "C" void SAL_CALL
uno_threadpool_attach( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C()
{
- sal_Sequence *pThreadId = 0;
+ sal_Sequence *pThreadId = nullptr;
uno_getIdOfCurrentThread( &pThreadId );
getThreadPool( hPool )->prepare( pThreadId );
rtl_byte_sequence_release( pThreadId );
@@ -429,7 +429,7 @@ extern "C" void SAL_CALL
uno_threadpool_enter( uno_ThreadPool hPool , void **ppJob )
SAL_THROW_EXTERN_C()
{
- sal_Sequence *pThreadId = 0;
+ sal_Sequence *pThreadId = nullptr;
uno_getIdOfCurrentThread( &pThreadId );
*ppJob =
getThreadPool( hPool )->enter(
@@ -493,7 +493,7 @@ uno_threadpool_destroy( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C()
if( empty )
{
delete g_pThreadpoolHashSet;
- g_pThreadpoolHashSet = 0;
+ g_pThreadpoolHashSet = nullptr;
}
}