diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-25 15:29:09 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-06-25 15:29:09 +0200 |
commit | b82f9ae304b8cdfada55d7dce93daf50cf7f8578 (patch) | |
tree | b44d4ad86089aa80a554ff9320491c62366279e9 /runtime | |
parent | 5af5b1e42868d00dfbc5fa47028768d0a03f8e32 (diff) | |
download | rsyslog-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.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/queue.c | 2 |
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); |