summaryrefslogtreecommitdiffstats
path: root/runtime/wtp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-20 09:47:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-20 09:47:12 +0200
commitb3978e7f7381c694a30a83c67c3fe2e1acc54207 (patch)
tree02bdcc2ba4f39fa15c1474567ab877e744050d2d /runtime/wtp.c
parent01acb7928e4e72b08279da15d376adff9c3c3840 (diff)
downloadrsyslog-b3978e7f7381c694a30a83c67c3fe2e1acc54207.tar.gz
rsyslog-b3978e7f7381c694a30a83c67c3fe2e1acc54207.tar.xz
rsyslog-b3978e7f7381c694a30a83c67c3fe2e1acc54207.zip
more cleanup/simplification (forgot to remove one mutex lock)
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r--runtime/wtp.c25
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.