diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-27 10:36:53 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-27 10:36:53 +0100 |
commit | 553d1880d47b57b2f4e023c2017675f010afd9a0 (patch) | |
tree | 47903062ec593e4a9ac1e0f6e2fd8e543af56fc4 /runtime/wtp.c | |
parent | 24cd5aee4720a98e321b69d2d9b5948348abd571 (diff) | |
download | rsyslog-553d1880d47b57b2f4e023c2017675f010afd9a0.tar.gz rsyslog-553d1880d47b57b2f4e023c2017675f010afd9a0.tar.xz rsyslog-553d1880d47b57b2f4e023c2017675f010afd9a0.zip |
some cleanup
Diffstat (limited to 'runtime/wtp.c')
-rw-r--r-- | runtime/wtp.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/runtime/wtp.c b/runtime/wtp.c index e075e5b8..060e6627 100644 --- a/runtime/wtp.c +++ b/runtime/wtp.c @@ -117,8 +117,7 @@ wtpConstructFinalize(wtp_t *pThis) /* alloc and construct workers - this can only be done in finalizer as we previously do * not know the max number of workers */ - if((pThis->pWrkr = MALLOC(sizeof(wti_t*) * pThis->iNumWorkerThreads)) == NULL) - ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); + CHKmalloc(pThis->pWrkr = MALLOC(sizeof(wti_t*) * pThis->iNumWorkerThreads)); for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i) { CHKiRet(wtiConstruct(&pThis->pWrkr[i])); @@ -190,10 +189,8 @@ wtpChkStopWrkr(wtp_t *pThis, int bLockUsrMutex) wtpState = ATOMIC_FETCH_32BIT(pThis->wtpState); if(wtpState == wtpState_SHUTDOWN_IMMEDIATE) { -RUNLOG_STR("WWW: ChkStopWrkr returns TERMINATE_NOW"); ABORT_FINALIZE(RS_RET_TERMINATE_NOW); } else if(wtpState == wtpState_SHUTDOWN) { -RUNLOG_STR("WWW: ChkStopWrkr returns TERMINATE_WHEN_IDLE"); ABORT_FINALIZE(RS_RET_TERMINATE_WHEN_IDLE); } @@ -429,7 +426,6 @@ wtpAdviseMaxWorkers(wtp_t *pThis, int nMaxWrkr) ISOBJ_TYPE_assert(pThis, wtp); -int nMaxWrkrTmp = nMaxWrkr; if(nMaxWrkr == 0) FINALIZE; @@ -437,10 +433,10 @@ int nMaxWrkrTmp = nMaxWrkr; nMaxWrkr = pThis->iNumWorkerThreads; nMissing = nMaxWrkr - ATOMIC_FETCH_32BIT(pThis->iCurNumWrkThrd); -dbgprintf("wtpAdviseMaxWorkers, nmax: %d, curr %d, missing %d\n", nMaxWrkrTmp, pThis->iNumWorkerThreads, nMissing); if(nMissing > 0) { - DBGPRINTF("%s: high activity - starting %d additional worker thread(s).\n", wtpGetDbgHdr(pThis), nMissing); + DBGPRINTF("%s: high activity - starting %d additional worker thread(s).\n", + wtpGetDbgHdr(pThis), nMissing); /* start the rqtd nbr of workers */ for(i = 0 ; i < nMissing ; ++i) { CHKiRet(wtpStartWrkr(pThis)); |