From 7a66a00e15c1e1abb816db08ca098a244538a163 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 10 Jul 2020 22:21:46 +0200 Subject: [PATCH] block_queue: add method to check if given queue is full --- lib/include/srslte/common/block_queue.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/include/srslte/common/block_queue.h b/lib/include/srslte/common/block_queue.h index ab14d5079..626dfee8c 100644 --- a/lib/include/srslte/common/block_queue.h +++ b/lib/include/srslte/common/block_queue.h @@ -113,6 +113,14 @@ public: return ret; } + bool full() + { // queue is full? + pthread_mutex_lock(&mutex); + bool ret = not check_queue_space_unlocked(false); + pthread_mutex_unlock(&mutex); + return ret; + } + void clear() { // remove all items myobj* item = NULL;