From 8113a4b0770b713ef9ebb3d546bcd6829497eccd Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Sat, 28 Jan 2023 14:41:01 +0100 Subject: [PATCH] queue fix --- src/Queue.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Queue.h b/src/Queue.h index 17bb331..ccfb4ca 100644 --- a/src/Queue.h +++ b/src/Queue.h @@ -17,7 +17,7 @@ class Queue { std::mutex mutex; void run() { while (!QApplication::closingDown()){ - if (!isEmpty()) + if (tail != head) update(); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } @@ -29,9 +29,6 @@ class Queue { size_t head = 0; T * container[MAX_QUEUE_SIZE]; protected: - bool isEmpty() const { - return tail == head; - } T * pop(){ mutex.lock(); T * element = container[head];