diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-05-03 09:25:06 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-05-03 09:25:06 +0200 |
commit | a4d9f6e70f4bbe24708067653516655474f46493 (patch) | |
tree | 6a1054780335e02774857d470963b44d1b4cf336 | |
parent | 8597affe159dfd44e75bcc72a1ce42eff61da96e (diff) | |
download | rsyslog-a4d9f6e70f4bbe24708067653516655474f46493.tar.gz rsyslog-a4d9f6e70f4bbe24708067653516655474f46493.tar.xz rsyslog-a4d9f6e70f4bbe24708067653516655474f46493.zip |
bugfix: inside queue.c, some thread cancel states were not correctly reset.
While this is a bug, we assume it did have no practical effect
because the reset as it was done was set to the state the code actually
had at this point. But better fix this...
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | runtime/queue.c | 9 |
2 files changed, 8 insertions, 5 deletions
@@ -11,6 +11,10 @@ Version 5.8.11 [V5-stable] 2012-04-?? - bugfix: hostname was not requeried on HUP Thanks to Per Jessen for reporting this bug and Marius Tomaschewski for his help in testing the fix. +- bugfix: inside queue.c, some thread cancel states were not correctly + reset. While this is a bug, we assume it did have no practical effect + because the reset as it was done was set to the state the code actually + had at this point. But better fix this... --------------------------------------------------------------------------- Version 5.8.10 [V5-stable] 2012-04-05 - bugfix: segfault on startup if $actionqueuefilename was missing for disk diff --git a/runtime/queue.c b/runtime/queue.c index 5e000cd2..9961ed4d 100644 --- a/runtime/queue.c +++ b/runtime/queue.c @@ -1715,7 +1715,7 @@ ConsumerReg(qqueue_t *pThis, wti_t *pWti) } /* but now cancellation is no longer permitted */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); + pthread_setcancelstate(iCancelStateSave, NULL); finalize_it: DBGPRINTF("regular consumer finished, iret=%d, szlog %d sz phys %d\n", iRet, @@ -1768,7 +1768,7 @@ ConsumerDA(qqueue_t *pThis, wti_t *pWti) } /* but now cancellation is no longer permitted */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); + pthread_setcancelstate(iCancelStateSave, NULL); /* now we are done, but need to re-aquire the mutex */ d_pthread_mutex_lock(pThis->mut); @@ -1847,7 +1847,6 @@ qqueueStart(qqueue_t *pThis) /* this is the ConstructionFinalizer */ int wrk; uchar *qName; size_t lenBuf; - int iQueueSizeSave; ASSERT(pThis != NULL); @@ -2244,8 +2243,8 @@ finalize_it: static inline rsRetVal doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) { - DEFiRet; struct timespec t; + DEFiRet; if(glbl.GetGlobalInputTermState()) { ABORT_FINALIZE(RS_RET_FORCE_TERM); @@ -2279,7 +2278,7 @@ doEnqSingleObj(qqueue_t *pThis, flowControl_t flowCtlType, void *pUsr) if(flowCtlType == eFLOWCTL_FULL_DELAY) { while(pThis->iQueueSize >= pThis->iFullDlyMrk) { DBGOPRINT((obj_t*) pThis, "enqueueMsg: FullDelay mark reached for full delayable message - blocking.\n"); - pthread_cond_wait(&pThis->belowFullDlyWtrMrk, pThis->mut); /* TODO error check? But what do then? */ + pthread_cond_wait(&pThis->belowFullDlyWtrMrk, pThis->mut); } } else if(flowCtlType == eFLOWCTL_LIGHT_DELAY) { if(pThis->iQueueSize >= pThis->iLightDlyMrk) { |