diff --git a/src/Queue.h b/src/Queue.h index 0079ead..12e8c49 100644 --- a/src/Queue.h +++ b/src/Queue.h @@ -9,7 +9,7 @@ #include #include -#define MAX_QUEUE_SIZE 10 +#define MAX_QUEUE_SIZE 100 template class Queue { @@ -36,7 +36,9 @@ protected: return tail == head; } size_t size() const { - return container.size(); + if (tail > head) + return tail - head; + return MAX_QUEUE_SIZE - head + tail; } T * pop(){ mutex.lock();