diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-07 12:57:49 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-07 12:57:49 +0100 |
commit | 23278699e35173f46effda964fd80b8f868e8b3e (patch) | |
tree | 35b8370799ac9ca9705a26bdee4c9f8309d07f31 /runtime/wti.c | |
parent | e3dc6041424a779ddce3da8d55af9bc71c99aa61 (diff) | |
parent | fb81cf202c0277f48c75f777fa47e4db4e59f0a3 (diff) | |
download | rsyslog-23278699e35173f46effda964fd80b8f868e8b3e.tar.gz rsyslog-23278699e35173f46effda964fd80b8f868e8b3e.tar.bz2 rsyslog-23278699e35173f46effda964fd80b8f868e8b3e.zip |
Merge branch 'master-ruleeng' into master-ruleeng-simd
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 4642b526..6b5d82c8 100644 --- a/runtime/wti.c +++ b/runtime/wti.c @@ -175,6 +175,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); @@ -185,6 +186,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) @@ -262,10 +264,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 */ } |