From b04122f3f7884de08eb5d59bb3fd2bff829f9039 Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 22 May 2005 15:49:22 +0000 Subject: Added multithreaded encoding support. --- src/queue.h | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) (limited to 'src/queue.h') diff --git a/src/queue.h b/src/queue.h index 7c56e93..fa03c8e 100644 --- a/src/queue.h +++ b/src/queue.h @@ -38,6 +38,9 @@ /* * $Log$ + * Revision 1.17 2005/05/22 15:49:22 deva + * Added multithreaded encoding support. + * * Revision 1.16 2005/05/19 14:10:22 deva * * Multithreading rulez? @@ -86,7 +89,6 @@ public: ~Queue(); void push(T *t); - void bpush(T *t); T *pop(); T *peek(); @@ -173,47 +175,6 @@ void Queue::push(T *t) pthread_mutex_unlock(&mutex); } -/** - * Push element on queue from the bottom. - */ -template -void Queue::bpush(T *t) -{ - if(locked) { - delete t; - return; - } - - pthread_mutex_lock(&mutex); - - buf_t *b = (buf_t*)xmalloc(sizeof(*b)); - b->data = (void*)t; - - assert(b != NULL); - - if(limit && count > 0) { - T* tmp = (T*)_pop(); - delete tmp; - } - - if(!head) { - head = tail = b; - b->next = b->prev = NULL; - count = 1; - pthread_mutex_unlock(&mutex); - return; - } - - b->prev = head; - b->next = NULL; - if(head) - head->next = b; - head = b; - count++; - - pthread_mutex_unlock(&mutex); -} - /** * Pop element from queue. * If queue is empty, NULL is returned. -- cgit v1.2.3