summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-11 10:11:55 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-11 10:11:55 +0000
commite095d1ab45b205b4849151b15592c2824f04373a (patch)
tree73fec9662d199fece800817138c2f87505ee7499 /queue.c
parentc9430404dbf38d5c7fdbbb8aebc78fce38c0906c (diff)
downloadrsyslog-e095d1ab45b205b4849151b15592c2824f04373a.tar.gz
rsyslog-e095d1ab45b205b4849151b15592c2824f04373a.tar.xz
rsyslog-e095d1ab45b205b4849151b15592c2824f04373a.zip
added $MainMsgQueueImmediateShutdown config directive
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/queue.c b/queue.c
index bd8f9223..b582fb13 100644
--- a/queue.c
+++ b/queue.c
@@ -345,7 +345,6 @@ static rsRetVal queueShutdownWorkers(queue_t *pThis)
int i;
qWrkCmd_t tShutdownCmd;
-pThis->bImmediateShutdown = 1; /*testing */
assert(pThis != NULL);
/* select shutdown mode */
@@ -415,7 +414,6 @@ queueWorker(void *arg)
/* now we have our identity, on to real processing */
while(pThis->pWrkThrds[iMyThrdIndx].tCurrCmd == eWRKTHRDCMD_RUN
|| (pThis->pWrkThrds[iMyThrdIndx].tCurrCmd == eWRKTHRDCMD_SHUTDOWN && pThis->iQueueSize > 0)) {
-dbgprintf("worker %d runs, cmd %d\n", iMyThrdIndx, pThis->pWrkThrds[iMyThrdIndx].tCurrCmd);
pthread_mutex_lock(pThis->mut);
while (pThis->iQueueSize == 0 && pThis->pWrkThrds[iMyThrdIndx].tCurrCmd == eWRKTHRDCMD_RUN) {
dbgprintf("Queue 0x%lx/w%d: queue EMPTY, waiting for next message.\n",
@@ -492,16 +490,13 @@ rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads,
assert(pConsumer != NULL);
assert(iWorkerThreads >= 0);
-dbgprintf("queueConstruct 0\n");
if((pThis = (queue_t *)calloc(1, sizeof(queue_t))) == NULL) {
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
}
-dbgprintf("queueConstruct 0a\n");
/* we have an object, so let's fill the properties */
if((pThis->pszSpoolDir = (uchar*) strdup((char*)glblGetWorkDir())) == NULL)
ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
-dbgprintf("queueConstruct 1\n");
pThis->lenSpoolDir = strlen((char*)pThis->pszSpoolDir);
pThis->iMaxFileSize = 1024 * 1024; /* default is 1 MiB */
@@ -519,7 +514,6 @@ dbgprintf("queueConstruct 1\n");
pThis->pszFilePrefix = NULL;
pThis->qType = qType;
-dbgprintf("queueConstruct 2\n");
/* set type-specific handlers and other very type-specific things (we can not totally hide it...) */
switch(qType) {
case QUEUETYPE_FIXED_ARRAY:
@@ -550,14 +544,11 @@ dbgprintf("queueConstruct 2\n");
break;
}
-dbgprintf("queueConstruct 3\n");
/* call type-specific constructor */
CHKiRet(pThis->qConstruct(pThis));
finalize_it:
-dbgprintf("queueConstruct 4\n");
OBJCONSTRUCT_CHECK_SUCCESS_AND_CLEANUP
-dbgprintf("queueConstruct 5\n");
return iRet;
}
@@ -718,6 +709,10 @@ finalize_it:
return iRet;
}
+
+/* some simple object access methods */
+DEFpropSetMeth(queue, bImmediateShutdown, int);
+
/*
* vi:set ai:
*/