diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-20 14:45:32 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-07-20 14:45:32 +0200 |
commit | 541696f307e9facc80f2aa153147a9456d41d3f9 (patch) | |
tree | 49eafaa54c1745947bd75998c0bab3907e89d1d1 /runtime | |
parent | 1c580743390c704bcfb44148f4a70254c2c247da (diff) | |
download | rsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.tar.gz rsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.tar.xz rsyslog-541696f307e9facc80f2aa153147a9456d41d3f9.zip |
bugfix: potential race condition in debug mode
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/wtp.c | 3 |
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 } |