From f7a15abfba79a9da1f125d48e75b3bb68ebe0e9e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 3 Jan 2008 14:57:23 +0000 Subject: added capability to use a linked list for queuing to the queue class --- queue.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'queue.h') 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; -- cgit v1.2.3