diff --git a/CMakeLists.txt b/CMakeLists.txt index ee0d4d8..2a0906c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -441,7 +441,6 @@ SET (cubicsdr_headers src/audio/AudioThread.h src/util/Gradient.h src/util/Timer.h - src/util/ThreadQueue.h src/util/ThreadBlockingQueue.h src/util/MouseTracker.h src/util/GLExt.h diff --git a/src/IOThread.h b/src/IOThread.h index 9750366..46ce897 100644 --- a/src/IOThread.h +++ b/src/IOThread.h @@ -12,7 +12,7 @@ #include #include -#include "ThreadQueue.h" +#include "ThreadBlockingQueue.h" #include "Timer.h" struct map_string_less : public std::binary_function diff --git a/src/audio/AudioThread.h b/src/audio/AudioThread.h index f472725..ce349c0 100644 --- a/src/audio/AudioThread.h +++ b/src/audio/AudioThread.h @@ -9,7 +9,6 @@ #include #include -#include "AudioThread.h" #include "ThreadBlockingQueue.h" #include "RtAudio.h" #include "DemodDefs.h" diff --git a/src/util/ThreadBlockingQueue.h b/src/util/ThreadBlockingQueue.h index 10fad27..ab95d93 100644 --- a/src/util/ThreadBlockingQueue.h +++ b/src/util/ThreadBlockingQueue.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #define MIN_ITEM_NB (1) @@ -21,6 +21,9 @@ //an indefnite timeout duration. #define BLOCKING_INFINITE_TIMEOUT (0) +class ThreadQueueBase { +}; + /** A thread-safe asynchronous blocking queue */ template class ThreadBlockingQueue : public ThreadQueueBase { @@ -29,7 +32,6 @@ class ThreadBlockingQueue : public ThreadQueueBase { typedef typename std::deque::size_type size_type; public: - /*! Create safe blocking queue. */ ThreadBlockingQueue() { @@ -37,6 +39,7 @@ public: m_max_num_items = MIN_ITEM_NB; }; + //Copy constructor ThreadBlockingQueue(const ThreadBlockingQueue& sq) { std::lock_guard < std::mutex > lock(sq.m_mutex); m_queue = sq.m_queue; @@ -57,7 +60,7 @@ public: std::lock_guard < std::mutex > lock(m_mutex); if (max_num_items > m_max_num_items) { - //Only raise the existing max size, never squash it + //Only raise the existing max size, never reduce it //for simplification sake at runtime. m_max_num_items = max_num_items; m_cond_not_full.notify_all();