summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-25 15:29:09 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-25 15:29:09 +0200
commitb82f9ae304b8cdfada55d7dce93daf50cf7f8578 (patch)
treeb44d4ad86089aa80a554ff9320491c62366279e9
parent5af5b1e42868d00dfbc5fa47028768d0a03f8e32 (diff)
downloadrsyslog-b82f9ae304b8cdfada55d7dce93daf50cf7f8578.tar.gz
rsyslog-b82f9ae304b8cdfada55d7dce93daf50cf7f8578.tar.xz
rsyslog-b82f9ae304b8cdfada55d7dce93daf50cf7f8578.zip
bugfix: subtle potential issue during queue shutdown
... this one could cause trouble, but I really don't think it caused any actual harm.
-rw-r--r--runtime/queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/queue.c b/runtime/queue.c
index 1e3b761f..13e7007a 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -110,7 +110,7 @@ static inline void queueDrain(qqueue_t *pThis)
ASSERT(pThis != NULL);
/* iQueueSize is not decremented by qDel(), so we need to do it ourselves */
- while(pThis->iQueueSize-- > 0) {
+ while(ATOMIC_DEC_AND_FETCH(pThis->iQueueSize) > 0) {
pThis->qDel(pThis, &pUsr);
if(pUsr != NULL) {
objDestruct(pUsr);