diff options
Diffstat (limited to 'mpeglib/lib/util/abstract')
-rw-r--r-- | mpeglib/lib/util/abstract/threadQueue.cpp | 16 | ||||
-rw-r--r-- | mpeglib/lib/util/abstract/threadQueue.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/mpeglib/lib/util/abstract/threadQueue.cpp b/mpeglib/lib/util/abstract/threadQueue.cpp index 1b130ba9..fd8a4a39 100644 --- a/mpeglib/lib/util/abstract/threadQueue.cpp +++ b/mpeglib/lib/util/abstract/threadQueue.cpp @@ -12,7 +12,7 @@ #include "threadQueue.h" -#define _MAX_THREAD_IN_QUEUE 5 +#define _MAX_THREAD_IN_TQUEUE 5 #include <iostream> @@ -37,9 +37,9 @@ WaitThreadEntry::~WaitThreadEntry() { ThreadQueue::ThreadQueue() { - waitThreadEntries=new WaitThreadEntry* [_MAX_THREAD_IN_QUEUE]; + waitThreadEntries=new WaitThreadEntry* [_MAX_THREAD_IN_TQUEUE]; int i; - for(i=0;i<_MAX_THREAD_IN_QUEUE;i++) { + for(i=0;i<_MAX_THREAD_IN_TQUEUE;i++) { waitThreadEntries[i]=new WaitThreadEntry(); } abs_thread_mutex_init(&queueMut); @@ -56,7 +56,7 @@ ThreadQueue::~ThreadQueue() { exit(0); } int i; - for(i=0;i<_MAX_THREAD_IN_QUEUE;i++) { + for(i=0;i<_MAX_THREAD_IN_TQUEUE;i++) { delete waitThreadEntries[i]; } delete [] waitThreadEntries; @@ -73,14 +73,14 @@ void ThreadQueue::waitForExclusiveAccess() { } // wait size++; - if (size == _MAX_THREAD_IN_QUEUE) { - cout << "Aieee! ThreadQueue can only buffer:"<<_MAX_THREAD_IN_QUEUE<<endl; + if (size == _MAX_THREAD_IN_TQUEUE) { + cout << "Aieee! ThreadQueue can only buffer:"<<_MAX_THREAD_IN_TQUEUE<<endl; exit(0); } abs_thread_cond_t* waitCond=&(waitThreadEntries[insertPos]->waitCond); insertPos++; // wrap counter - if (insertPos == _MAX_THREAD_IN_QUEUE) { + if (insertPos == _MAX_THREAD_IN_TQUEUE) { insertPos=0; } abs_thread_cond_wait(waitCond,&queueMut); @@ -98,7 +98,7 @@ void ThreadQueue::releaseExclusiveAccess() { abs_thread_cond_t* waitCond=&(waitThreadEntries[removePos]->waitCond); removePos++; // wrap counter - if (removePos == _MAX_THREAD_IN_QUEUE) { + if (removePos == _MAX_THREAD_IN_TQUEUE) { removePos=0; } size--; diff --git a/mpeglib/lib/util/abstract/threadQueue.h b/mpeglib/lib/util/abstract/threadQueue.h index 4c650e21..765713b6 100644 --- a/mpeglib/lib/util/abstract/threadQueue.h +++ b/mpeglib/lib/util/abstract/threadQueue.h @@ -11,8 +11,8 @@ */ -#ifndef __THREADQUEUE_H -#define __THREADQUEUE_H +#ifndef __THREADTQUEUE_H +#define __THREADTQUEUE_H #include "abs_thread.h" |