diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-07 12:57:36 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-07 12:57:36 +0100 |
commit | fb81cf202c0277f48c75f777fa47e4db4e59f0a3 (patch) | |
tree | 804c7265d82e0bb7127b31a9a7d68cc4b616e279 /runtime/wti.c | |
parent | ec32919ca05598f11f538060c406d8668a35e229 (diff) | |
parent | 9035771b7dbea738b8a22949a7f0a6514525fafb (diff) | |
download | rsyslog-fb81cf202c0277f48c75f777fa47e4db4e59f0a3.tar.gz rsyslog-fb81cf202c0277f48c75f777fa47e4db4e59f0a3.tar.bz2 rsyslog-fb81cf202c0277f48c75f777fa47e4db4e59f0a3.zip |
Merge branch 'master' into master-ruleeng
Conflicts:
runtime/wti.c
runtime/wti.h
Diffstat (limited to 'runtime/wti.c')
-rw-r--r-- | runtime/wti.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/wti.c b/runtime/wti.c index df77bc19..c2077a51 100644 --- a/runtime/wti.c +++ b/runtime/wti.c @@ -173,6 +173,7 @@ CODESTARTobjDestruct(wti) /* actual destruction */ batchFree(&pThis->batch); free(pThis->actWrkrInfo); + pthread_cond_destroy(&pThis->pcondBusy); DESTROY_ATOMIC_HELPER_MUT(pThis->mutIsRunning); free(pThis->pszDbgHdr); @@ -183,6 +184,7 @@ ENDobjDestruct(wti) */ BEGINobjConstruct(wti) /* be sure to specify the object type also in END macro! */ INIT_ATOMIC_HELPER_MUT(pThis->mutIsRunning); + pthread_cond_init(&pThis->pcondBusy, NULL); ENDobjConstruct(wti) @@ -255,10 +257,10 @@ doIdleProcessing(wti_t *pThis, wtp_t *pWtp, int *pbInactivityTOOccured) if(pThis->bAlwaysRunning) { /* never shut down any started worker */ - d_pthread_cond_wait(pWtp->pcondBusy, pWtp->pmutUsr); + d_pthread_cond_wait(&pThis->pcondBusy, pWtp->pmutUsr); } else { timeoutComp(&t, pWtp->toWrkShutdown);/* get absolute timeout */ - if(d_pthread_cond_timedwait(pWtp->pcondBusy, pWtp->pmutUsr, &t) != 0) { + if(d_pthread_cond_timedwait(&pThis->pcondBusy, pWtp->pmutUsr, &t) != 0) { DBGPRINTF("%s: inactivity timeout, worker terminating...\n", wtiGetDbgHdr(pThis)); *pbInactivityTOOccured = 1; /* indicate we had a timeout */ } |