From b3978e7f7381c694a30a83c67c3fe2e1acc54207 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 20 Jul 2009 09:47:12 +0200 Subject: more cleanup/simplification (forgot to remove one mutex lock) --- runtime/wtp.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'runtime/wtp.c') diff --git a/runtime/wtp.c b/runtime/wtp.c index 4d4d0f0e..e1ebcd4c 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -304,8 +304,8 @@ wtpWrkrExecCancelCleanup(void *arg) // TODO: the mutex_lock is dangerous, if we are cancelled within some function // that already has the mutex locked... d_pthread_mutex_lock(&pThis->mutWtp); - pThis->iCurNumWrkThrd--; wtiSetState(pWti, WRKTHRD_STOPPED); + pThis->iCurNumWrkThrd--; pthread_cond_signal(&pThis->condThrdTrm); /* activate anyone waiting on thread shutdown */ d_pthread_mutex_unlock(&pThis->mutWtp); @@ -463,29 +463,6 @@ DEFpropSetMethFP(wtp, pfOnWorkerStartup, rsRetVal(*pVal)(void*)) DEFpropSetMethFP(wtp, pfOnWorkerShutdown, rsRetVal(*pVal)(void*)) -/* return the current number of worker threads. - * TODO: atomic operation would bring a nice performance - * enhancemcent - * rgerhards, 2008-01-27 - */ -int -wtpGetCurNumWrkr(wtp_t *pThis, int bLockMutex) -{ - DEFVARS_mutexProtection; - int iNumWrkr; - - BEGINfunc - ISOBJ_TYPE_assert(pThis, wtp); - - BEGIN_MTX_PROTECTED_OPERATIONS(&pThis->mutWtp, bLockMutex); - iNumWrkr = pThis->iCurNumWrkThrd; - END_MTX_PROTECTED_OPERATIONS(&pThis->mutWtp); - - ENDfunc - return iNumWrkr; -} - - /* set the debug header message * The passed-in string is duplicated. So if the caller does not need * it any longer, it must free it. Must be called only before object is finalized. -- cgit