diff options
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r-- | runtime/wtp.c | 25 |
1 files changed, 1 insertions, 24 deletions
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. |