summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-11 09:53:53 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-11 09:53:53 +0000
commitc9430404dbf38d5c7fdbbb8aebc78fce38c0906c (patch)
tree5c65306b8a4ec500e7c6ec21f110274d371c98ad /queue.h
parent68efb41220a834870681f293481655ed47e7b197 (diff)
downloadrsyslog-c9430404dbf38d5c7fdbbb8aebc78fce38c0906c.tar.gz
rsyslog-c9430404dbf38d5c7fdbbb8aebc78fce38c0906c.tar.xz
rsyslog-c9430404dbf38d5c7fdbbb8aebc78fce38c0906c.zip
- begun to permit queue to terminate without being drained
- fixed a starvation condition in queueWorker (pthread_yield() was needed) could not be seen with any previously released code, came up during new development
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/queue.h b/queue.h
index b4dd1000..07621972 100644
--- a/queue.h
+++ b/queue.h
@@ -69,7 +69,7 @@ typedef enum {
typedef struct qWrkThrd_s {
pthread_t thrdID; /* thread ID */
- qWrkCmd_t tCurrCmd; /* current command to be carried out by worker */
+ volatile qWrkCmd_t tCurrCmd; /* current command to be carried out by worker */
} qWrkThrd_t; /* type for queue worker threads */
/* the queue object */
@@ -79,7 +79,6 @@ typedef struct queue_s {
int iMaxQueueSize; /* how large can the queue grow? */
int iNumWorkerThreads;/* number of worker threads to use */
qWrkThrd_t *pWrkThrds;/* array with control structure for the worker thread(s) associated with this queue */
- int bDoRun; /* 1 - run queue, 0 - shutdown of queue requested */
int bImmediateShutdown;/* on shutdown, drain the queue --> 0 / do NOT drain the queue --> 1 */
rsRetVal (*pConsumer)(void *); /* user-supplied consumer function for dequeued messages */
/* type-specific handlers (set during construction) */