diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-29 11:13:12 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-29 11:13:12 +0000 |
commit | 23dd725925d75f519aa40058805bafcb29b340ce (patch) | |
tree | 25033f13910e23af6d65517040c9b3c80d6a8abf /queue.c | |
parent | 57d1546ea16cbfaf636623dfc39a98793d86405d (diff) | |
download | rsyslog-23dd725925d75f519aa40058805bafcb29b340ce.tar.gz rsyslog-23dd725925d75f519aa40058805bafcb29b340ce.tar.xz rsyslog-23dd725925d75f519aa40058805bafcb29b340ce.zip |
- fine tuning on queue naming
- action queues are now also named (otherwise you can't read the debug log
;))
Diffstat (limited to 'queue.c')
-rw-r--r-- | queue.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -198,6 +198,7 @@ static rsRetVal queueStartDA(queue_t *pThis) { DEFiRet; + uchar pszDAQName[128]; ISOBJ_TYPE_assert(pThis, queue); @@ -207,6 +208,10 @@ queueStartDA(queue_t *pThis) /* create message queue */ CHKiRet(queueConstruct(&pThis->pqDA, QUEUETYPE_DISK , 1, 0, pThis->pConsumer)); + /* give it a name */ + snprintf((char*) pszDAQName, sizeof(pszDAQName)/sizeof(uchar), "%s[DA]", objGetName((obj_t*) pThis)); + objSetName((obj_t*) pThis->pqDA, pszDAQName); + /* as the created queue is the same object class, we take the * liberty to access its properties directly. */ @@ -286,7 +291,7 @@ queueInitDA(queue_t *pThis, int bEnqOnly, int bLockMutex) * rgerhards, 2008-01-24 */ if(pThis->pWtpDA == NULL) { - lenBuf = snprintf((char*)pszBuf, sizeof(pszBuf), "Queue 0x%lx:DA", (unsigned long) pThis); + lenBuf = snprintf((char*)pszBuf, sizeof(pszBuf), "%s:DA", objGetName((obj_t*) pThis)); CHKiRet(wtpConstruct (&pThis->pWtpDA)); CHKiRet(wtpSetDbgHdr (pThis->pWtpDA, pszBuf, lenBuf)); CHKiRet(wtpSetpfChkStopWrkr (pThis->pWtpDA, (rsRetVal (*)(void *pUsr, int)) queueChkStopWrkrDA)); @@ -1413,7 +1418,7 @@ rsRetVal queueStart(queue_t *pThis) /* this is the ConstructionFinalizer */ /* create worker thread pools for regular operation. The DA pool is created on an as-needed * basis, which potentially means never under most circumstances. */ - lenBuf = snprintf((char*)pszBuf, sizeof(pszBuf), "Queue 0x%lx:Reg", (unsigned long) pThis); + lenBuf = snprintf((char*)pszBuf, sizeof(pszBuf), "%s:Reg", objGetName((obj_t*) pThis)); CHKiRet(wtpConstruct (&pThis->pWtpReg)); CHKiRet(wtpSetDbgHdr (pThis->pWtpReg, pszBuf, lenBuf)); CHKiRet(wtpSetpfChkStopWrkr (pThis->pWtpReg, (rsRetVal (*)(void *pUsr, int)) queueChkStopWrkrReg)); |