diff options
Diffstat (limited to 'mpeglib/lib/util/abstract/threadQueue.cpp')
-rw-r--r-- | mpeglib/lib/util/abstract/threadQueue.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mpeglib/lib/util/abstract/threadQueue.cpp b/mpeglib/lib/util/abstract/threadQueue.cpp index fd8a4a39..1b130ba9 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_TQUEUE 5 +#define _MAX_THREAD_IN_QUEUE 5 #include <iostream> @@ -37,9 +37,9 @@ WaitThreadEntry::~WaitThreadEntry() { ThreadQueue::ThreadQueue() { - waitThreadEntries=new WaitThreadEntry* [_MAX_THREAD_IN_TQUEUE]; + waitThreadEntries=new WaitThreadEntry* [_MAX_THREAD_IN_QUEUE]; int i; - for(i=0;i<_MAX_THREAD_IN_TQUEUE;i++) { + for(i=0;i<_MAX_THREAD_IN_QUEUE;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_TQUEUE;i++) { + for(i=0;i<_MAX_THREAD_IN_QUEUE;i++) { delete waitThreadEntries[i]; } delete [] waitThreadEntries; @@ -73,14 +73,14 @@ void ThreadQueue::waitForExclusiveAccess() { } // wait size++; - if (size == _MAX_THREAD_IN_TQUEUE) { - cout << "Aieee! ThreadQueue can only buffer:"<<_MAX_THREAD_IN_TQUEUE<<endl; + if (size == _MAX_THREAD_IN_QUEUE) { + cout << "Aieee! ThreadQueue can only buffer:"<<_MAX_THREAD_IN_QUEUE<<endl; exit(0); } abs_thread_cond_t* waitCond=&(waitThreadEntries[insertPos]->waitCond); insertPos++; // wrap counter - if (insertPos == _MAX_THREAD_IN_TQUEUE) { + if (insertPos == _MAX_THREAD_IN_QUEUE) { 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_TQUEUE) { + if (removePos == _MAX_THREAD_IN_QUEUE) { removePos=0; } size--; |