summaryrefslogtreecommitdiffstats
path: root/queue.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-03 14:57:23 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-03 14:57:23 +0000
commitf7a15abfba79a9da1f125d48e75b3bb68ebe0e9e (patch)
treedb901e43604c22cc5367c02d1a88acdd82e02193 /queue.h
parentfc761b9fdc5486a0072ee63d8b438f562127d057 (diff)
downloadrsyslog-f7a15abfba79a9da1f125d48e75b3bb68ebe0e9e.tar.gz
rsyslog-f7a15abfba79a9da1f125d48e75b3bb68ebe0e9e.tar.xz
rsyslog-f7a15abfba79a9da1f125d48e75b3bb68ebe0e9e.zip
added capability to use a linked list for queuing to the queue class
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/queue.h b/queue.h
index 0021dd08..730a5c50 100644
--- a/queue.h
+++ b/queue.h
@@ -31,9 +31,16 @@ typedef enum {
QUEUETYPE_LINKEDLIST,/* linked list used as buffer, lower fixed memory overhead but slower */
} queueType_t;
+/* list member definition for linked list types of queues: */
+typedef struct qLinkedList_S {
+ struct qLinkedList_S *pNext;
+ void *pUsr;
+} qLinkedList_t;
+
/* the queue object */
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 bDoRun; /* 1 - run queue, 0 - shutdown of queue requested */
@@ -54,6 +61,10 @@ typedef struct queue_s {
long head, tail;
void** pBuf; /* the queued user data structure */
} farray;
+ struct {
+ qLinkedList_t *pRoot;
+ qLinkedList_t *pLast;
+ } linklist;
} tVars;
} queue_t;