summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-05 15:58:33 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-05 15:58:33 +0000
commit558003a7250d878c8cc52bf2d8863394b9baf835 (patch)
tree6564e5791397e428bf168a9a27125c980080bbd6 /queue.h
parent62154cdde95ad579d4b2b98f59fac4817be8a0f4 (diff)
downloadrsyslog-558003a7250d878c8cc52bf2d8863394b9baf835.tar.gz
rsyslog-558003a7250d878c8cc52bf2d8863394b9baf835.tar.xz
rsyslog-558003a7250d878c8cc52bf2d8863394b9baf835.zip
- added multiple worker thread capability to queue class
- implemented $MainMsgQueueWorkerThreads config directive
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/queue.h b/queue.h
index a01f2496..8c8782d3 100644
--- a/queue.h
+++ b/queue.h
@@ -45,7 +45,8 @@ typedef struct queue_s {
queueType_t qType;
int iQueueSize; /* Current number of elements in the queue */
int iMaxQueueSize; /* how large can the queue grow? */
- pthread_t thrdWorker; /* ID of the worker thread associated with this queue */
+ int iNumWorkerThreads;/* number of worker threads to use */
+ pthread_t *pWorkerThreads;/* array with ID of the worker thread(s) associated with this queue */
int bDoRun; /* 1 - run queue, 0 - shutdown of queue requested */
rsRetVal (*pConsumer)(void *); /* user-supplied consumer function for dequeued messages */
/* type-specific handlers (set during construction) */
@@ -84,7 +85,8 @@ typedef struct queue_s {
/* prototypes */
rsRetVal queueDestruct(queue_t *pThis);
rsRetVal queueEnqObj(queue_t *pThis, void *pUsr);
-rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iMaxQueueSize, rsRetVal (*pConsumer)(void*));
rsRetVal queueStart(queue_t *pThis);
+rsRetVal queueConstruct(queue_t **ppThis, queueType_t qType, int iWorkerThreads,
+ int iMaxQueueSize, rsRetVal (*pConsumer)(void*));
#endif /* #ifndef QUEUE_H_INCLUDED */