diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-28 09:59:45 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-05-28 09:59:45 +0200 |
commit | 9517e19b6427c295e206ece9562ce70f4a6d7044 (patch) | |
tree | 783fa1af0c03e05f10cb3b54149b6fcba508263d /runtime/wti.c | |
parent | d4564f8399f4362c7e79066370049f909cef996c (diff) | |
download | rsyslog-9517e19b6427c295e206ece9562ce70f4a6d7044.tar.gz rsyslog-9517e19b6427c295e206ece9562ce70f4a6d7044.tar.xz rsyslog-9517e19b6427c295e206ece9562ce70f4a6d7044.zip |
preserving current changes
... in preparation for some larger changes - I need to apply some
serious design changes, as the current system does not play well
at all with ultra-reliable queues. Will do that in a totally new version.
Diffstat (limited to 'runtime/wti.c')
-rw-r--r-- | runtime/wti.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/runtime/wti.c b/runtime/wti.c index 75e497b8..2fb5eea2 100644 --- a/runtime/wti.c +++ b/runtime/wti.c @@ -392,11 +392,8 @@ wtiWorker(wti_t *pThis) dbgSetThrdName(pThis->pszDbgHdr); pthread_cleanup_push(wtiWorkerCancelCleanup, pThis); -dbgprintf("XXX: worker startup\n"); - RUNLOG_STR("MUTEX lock"); BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); pWtp->pfOnWorkerStartup(pWtp->pUsr); - RUNLOG_STR("MUTEX release"); END_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); /* now we have our identity, on to real processing */ @@ -410,21 +407,17 @@ dbgprintf("XXX: worker startup\n"); } wtpSetInactivityGuard(pThis->pWtp, 0, LOCK_MUTEX); /* must be set before usr mutex is locked! */ - RUNLOG_STR("MUTEX lock"); BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); /* first check if we are in shutdown process (but evaluate a bit later) */ -RUNLOG; terminateRet = wtpChkStopWrkr(pWtp, LOCK_MUTEX, MUTEX_ALREADY_LOCKED); -RUNLOG_VAR("%d", terminateRet); if(terminateRet == RS_RET_TERMINATE_NOW) { /* we now need to free the old batch */ localRet = pWtp->pfObjProcessed(pWtp->pUsr, pThis); - dbgoprint((obj_t*) pThis, "terminating worker because auf TERMINATE_NOW mode, del iRet %d\n", + dbgoprint((obj_t*) pThis, "terminating worker because of TERMINATE_NOW mode, del iRet %d\n", localRet); break; } -RUNLOG; /* try to execute and process whatever we have */ localRet = pWtp->pfDoWork(pWtp->pUsr, pThis, iCancelStateSave); @@ -439,10 +432,8 @@ RUNLOG; /* we had an inactivity timeout in the last run and are still idle, so it is time to exit... */ break; /* end worker thread run */ } - RUNLOG_STR("MUTEX lock"); BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); doIdleProcessing(pThis, pWtp, &bInactivityTOOccured); - RUNLOG_STR("MUTEX release"); END_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); continue; /* request next iteration */ } @@ -451,7 +442,6 @@ RUNLOG; } /* if we exit the loop, the mutex is locked and must be unlocked */ - RUNLOG_STR("MUTEX release"); END_MTX_PROTECTED_OPERATIONS_UNCOND(pWtp->pmutUsr); /* indicate termination */ @@ -459,6 +449,7 @@ RUNLOG; d_pthread_mutex_lock(&pThis->mut); pthread_cleanup_pop(0); /* remove cleanup handler */ +RUNLOG_STR("XXX: Worker shutdown"); pWtp->pfOnWorkerShutdown(pWtp->pUsr); wtiSetState(pThis, eWRKTHRD_TERMINATING, 0, MUTEX_ALREADY_LOCKED); |