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 /runtime | |
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...
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/queue.c | 9 |
1 files changed, 4 insertions, 5 deletions
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) { |