From 1f4c85d0f56bb633bb31d4a0cbaf30c19b9fbbcd Mon Sep 17 00:00:00 2001 From: Chris Sherlock Date: Sun, 7 May 2017 07:55:10 +1000 Subject: tdf#43157: convert cppu's threadpool from OSL_ASSERT to assert Change-Id: Id9cb46db0dd6f635014982ce958804dd0f02dd83 --- cppu/source/threadpool/current.cxx | 14 +++++++------- cppu/source/threadpool/jobqueue.cxx | 2 +- cppu/source/threadpool/thread.cxx | 2 +- cppu/source/threadpool/threadident.cxx | 8 ++++---- cppu/source/threadpool/threadpool.cxx | 14 +++++++------- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'cppu') diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index 1b82a02d30cc..be679ef65c6f 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.cxx @@ -181,7 +181,7 @@ extern "C" sal_Bool SAL_CALL uno_setCurrentContext( SAL_THROW_EXTERN_C() { IdContainer * pId = getIdContainer(); - OSL_ASSERT( pId ); + assert( pId ); // free old one if (pId->pCurrentContext) @@ -199,7 +199,7 @@ extern "C" sal_Bool SAL_CALL uno_setCurrentContext( { uno_Environment * pEnv = nullptr; ::uno_getEnvironment( &pEnv, pEnvTypeName, pEnvContext ); - OSL_ASSERT( pEnv && pEnv->pExtEnv ); + assert( pEnv && pEnv->pExtEnv ); if (pEnv) { if (pEnv->pExtEnv) @@ -228,7 +228,7 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( SAL_THROW_EXTERN_C() { IdContainer * pId = getIdContainer(); - OSL_ASSERT( pId ); + assert( pId ); Environment target_env; @@ -236,11 +236,11 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( if (*ppCurrentContext) { target_env = Environment(rtl::OUString(pEnvTypeName), pEnvContext); - OSL_ASSERT( target_env.is() ); + assert( target_env.is() ); if (! target_env.is()) return false; uno_ExtEnvironment * pEnv = target_env.get()->pExtEnv; - OSL_ASSERT( nullptr != pEnv ); + assert( nullptr != pEnv ); if (nullptr == pEnv) return false; (*pEnv->releaseInterface)( pEnv, *ppCurrentContext ); @@ -255,13 +255,13 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( if (! target_env.is()) { target_env = Environment(rtl::OUString(pEnvTypeName), pEnvContext); - OSL_ASSERT( target_env.is() ); + assert( target_env.is() ); if (! target_env.is()) return false; } Mapping mapping(&pId->pCurrentContextEnv->aBase, target_env.get()); - OSL_ASSERT( mapping.is() ); + assert( mapping.is() ); if (! mapping.is()) return false; diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx index 2d375dcf8bbd..81246cf25111 100644 --- a/cppu/source/threadpool/jobqueue.cxx +++ b/cppu/source/threadpool/jobqueue.cxx @@ -89,7 +89,7 @@ namespace cppu_threadpool { break; } - OSL_ASSERT( ! m_lstJob.empty() ); + assert(!m_lstJob.empty()); if( ! m_lstJob.empty() ) { job = m_lstJob.front(); diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx index 8dfa93bd443f..09ad6442c84f 100644 --- a/cppu/source/threadpool/thread.cxx +++ b/cppu/source/threadpool/thread.cxx @@ -157,7 +157,7 @@ namespace cppu_threadpool { { if ( !uno_bindIdToCurrentThread( m_aThreadId.getHandle() ) ) { - OSL_ASSERT( false ); + assert(false); } } diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx index 24037f6e4d2e..e27fcac87269 100644 --- a/cppu/source/threadpool/threadident.cxx +++ b/cppu/source/threadpool/threadident.cxx @@ -84,9 +84,9 @@ extern "C" void SAL_CALL uno_releaseIdFromCurrentThread() SAL_THROW_EXTERN_C() { IdContainer *p = getIdContainer(); - OSL_ASSERT( p ); - OSL_ASSERT( p->bInit ); - OSL_ASSERT( p->nRefCountOfCurrentId ); + assert( p ); + assert( p->bInit ); + assert( p->nRefCountOfCurrentId ); p->nRefCountOfCurrentId --; if( ! p->nRefCountOfCurrentId && (p->pLocalThreadId != p->pCurrentId) ) @@ -110,7 +110,7 @@ extern "C" sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId } else { - OSL_ASSERT( 0 == p->nRefCountOfCurrentId ); + assert( 0 == p->nRefCountOfCurrentId ); if( 0 == p->nRefCountOfCurrentId ) { rtl_byte_sequence_assign(&( p->pCurrentId ), pThreadId ); diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index a508f56e6aec..853325bb69f3 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.cxx @@ -158,7 +158,7 @@ namespace cppu_threadpool // thread wasn't reused, remove it from the list WaitingThreadList::iterator ii = find( m_lstThreads.begin(), m_lstThreads.end(), &waitingThread ); - OSL_ASSERT( ii != m_lstThreads.end() ); + assert( ii != m_lstThreads.end() ); m_lstThreads.erase( ii ); } } @@ -212,7 +212,7 @@ namespace cppu_threadpool MutexGuard guard( m_mutex ); ThreadIdHashMap::iterator ii = m_mapQueue.find( aThreadId ); - OSL_ASSERT( ii != m_mapQueue.end() ); + assert( ii != m_mapQueue.end() ); if( bAsynchron ) { @@ -266,7 +266,7 @@ namespace cppu_threadpool { m_mapQueue[ aThreadId ] = pair < JobQueue * , JobQueue * > ( nullptr , nullptr ); ii = m_mapQueue.find( aThreadId ); - OSL_ASSERT( ii != m_mapQueue.end() ); + assert( ii != m_mapQueue.end() ); } if( bAsynchron ) @@ -323,11 +323,11 @@ namespace cppu_threadpool ThreadIdHashMap::iterator ii = m_mapQueue.find( aThreadId ); - OSL_ASSERT( ii != m_mapQueue.end() ); + assert( ii != m_mapQueue.end() ); pQueue = (*ii).second.first; } - OSL_ASSERT( pQueue ); + assert( pQueue ); void *pReturn = pQueue->enter( nDisposeId ); if( pQueue->isCallstackEmpty() ) @@ -477,12 +477,12 @@ uno_threadpool_destroy( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C() bool empty; { - OSL_ASSERT( g_pThreadpoolHashSet ); + assert( g_pThreadpoolHashSet ); MutexGuard guard( Mutex::getGlobalMutex() ); ThreadpoolHashSet::iterator ii = g_pThreadpoolHashSet->find( hPool ); - OSL_ASSERT( ii != g_pThreadpoolHashSet->end() ); + assert( ii != g_pThreadpoolHashSet->end() ); g_pThreadpoolHashSet->erase( ii ); delete hPool; -- cgit