From d20ff45fc6086da492c4e226258748f05caf1fda Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 24 Feb 2022 20:55:53 +0100 Subject: [PATCH] Remove logging module dependency from Tpool --- common/utils/threadPool/thread-pool.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index 2ca152bb02..7d2365fb52 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -30,7 +30,6 @@ #include #include #include -#include #include //#include @@ -103,13 +102,9 @@ static inline void *NotifiedFifoData(notifiedFIFO_elt_t *elt) { } static inline void delNotifiedFIFO_elt(notifiedFIFO_elt_t *elt) { - if (elt->malloced) { - elt->malloced=false; - free(elt); - } else - printf("delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); - - //LOG_W(UTIL,"delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); + AssertFatal(elt->malloced, "delNotifiedFIFO on something not allocated by newNotifiedFIFO\n"); + elt->malloced=false; + free(elt); } static inline void initNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf) { @@ -148,8 +143,7 @@ static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t notifiedFIFO_elt_t *ret=nf->outF; - if (nf->outF==nf->outF->next) - LOG_E(UTIL,"Circular list in thread pool: push several times the same buffer is forbidden\n"); + AssertFatal(nf->outF != nf->outF->next,"Circular list in thread pool: push several times the same buffer is forbidden\n"); nf->outF=nf->outF->next;