From 178e2773ed28854f5074473ff3c358e8c6ab8a07 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 30 Jun 2022 11:43:22 +0200 Subject: [PATCH] Handle abortFIFO in FIFO functions --- common/utils/threadPool/thread-pool.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/utils/threadPool/thread-pool.h b/common/utils/threadPool/thread-pool.h index c07a6a073f..9b08bed8b8 100644 --- a/common/utils/threadPool/thread-pool.h +++ b/common/utils/threadPool/thread-pool.h @@ -131,14 +131,18 @@ static inline void pushNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf, notifiedFIF static inline void pushNotifiedFIFO(notifiedFIFO_t *nf, notifiedFIFO_elt_t *msg) { mutexlock(nf->lockF); - pushNotifiedFIFO_nothreadSafe(nf,msg); - condsignal(nf->notifF); + if (!nf->abortFIFO) { + pushNotifiedFIFO_nothreadSafe(nf,msg); + condsignal(nf->notifF); + } mutexunlock(nf->lockF); } static inline notifiedFIFO_elt_t *pullNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf) { if (nf->outF == NULL) return NULL; + if (nf->abortFIFO) + return NULL; notifiedFIFO_elt_t *ret=nf->outF;