summaryrefslogtreecommitdiffstats
path: root/runtime/wti.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-26 13:54:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-26 13:54:45 +0200
commitefa8dfb47da3ea46f06ab561aeb82ef1d6c3ee93 (patch)
tree853752612a18cbc37ec311e366d8a12cdfa07f31 /runtime/wti.c
parent71c851683b8911b2a6c37934dddff237902618bd (diff)
downloadrsyslog-efa8dfb47da3ea46f06ab561aeb82ef1d6c3ee93.tar.gz
rsyslog-efa8dfb47da3ea46f06ab561aeb82ef1d6c3ee93.tar.bz2
rsyslog-efa8dfb47da3ea46f06ab561aeb82ef1d6c3ee93.zip
maintain action ids (actionNbr)
Diffstat (limited to 'runtime/wti.c')
-rw-r--r--runtime/wti.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/wti.c b/runtime/wti.c
index f91fb5a9..e9d3599d 100644
--- a/runtime/wti.c
+++ b/runtime/wti.c
@@ -44,6 +44,7 @@
#include "wti.h"
#include "obj.h"
#include "glbl.h"
+#include "action.h"
#include "atomic.h"
/* static data */
@@ -171,6 +172,7 @@ BEGINobjDestruct(wti) /* be sure to specify the object type also in END and CODE
CODESTARTobjDestruct(wti)
/* actual destruction */
batchFree(&pThis->batch);
+ free(pThis->actWrkrData);
DESTROY_ATOMIC_HELPER_MUT(pThis->mutIsRunning);
free(pThis->pszDbgHdr);
@@ -195,11 +197,15 @@ wtiConstructFinalize(wti_t *pThis)
ISOBJ_TYPE_assert(pThis, wti);
- DBGPRINTF("%s: finalizing construction of worker instance data\n", wtiGetDbgHdr(pThis));
+ DBGPRINTF("%s: finalizing construction of worker instance data (for %d actions)\n",
+ wtiGetDbgHdr(pThis), iActionNbr);
/* initialize our thread instance descriptor (no concurrency here) */
pThis->bIsRunning = RSFALSE;
+ /* must use calloc as we need zeto-init */
+ CHKmalloc(pThis->actWrkrData = calloc(iActionNbr, sizeof(void*)));
+
/* we now alloc the array for user pointers. We obtain the max from the queue itself. */
CHKiRet(pThis->pWtp->pfGetDeqBatchSize(pThis->pWtp->pUsr, &iDeqBatchSize));
CHKiRet(batchInit(&pThis->batch, iDeqBatchSize));