summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-20 14:45:32 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-20 14:45:32 +0200
commit541696f307e9facc80f2aa153147a9456d41d3f9 (patch)
tree49eafaa54c1745947bd75998c0bab3907e89d1d1
parent1c580743390c704bcfb44148f4a70254c2c247da (diff)
downloadrsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.tar.gz
rsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.tar.xz
rsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.zip
bugfix: potential race condition in debug mode
-rw-r--r--runtime/wtp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c
index af4c7621..4524e0c3 100644
--- a/runtime/wtp.c
+++ b/runtime/wtp.c
@@ -305,10 +305,11 @@ wtpWrkrExecCancelCleanup(void *arg)
/* the order of the next two statements is important! */
wtiSetState(pWti, WRKTHRD_STOPPED);
ATOMIC_DEC(pThis->iCurNumWrkThrd);
- pthread_cond_broadcast(&pThis->condThrdTrm); /* activate anyone waiting on thread shutdown */
DBGPRINTF("%s: Worker thread %lx, terminated, num workers now %d\n",
wtpGetDbgHdr(pThis), (unsigned long) pWti, ATOMIC_FETCH_32BIT(pThis->iCurNumWrkThrd));
+
+ pthread_cond_broadcast(&pThis->condThrdTrm); /* activate anyone waiting on thread shutdown */
ENDfunc
}