From 15a735f805993c8f6bc8229800a4dc7b2c4cca78 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Tue, 21 Apr 2015 10:55:47 +1000 Subject: [PATCH] Broadcast in message queues instead of signalling for when there are multiple queue parsing threads --- src/ckpool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ckpool.c b/src/ckpool.c index 70725e08..218139de 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -175,7 +175,7 @@ ckmsgq_t *create_ckmsgqs(ckpool_t *ckp, const char *name, const void *func, cons } /* Generic function for adding messages to a ckmsgq linked list and signal the - * ckmsgq parsing thread to wake up and process it. */ + * ckmsgq parsing thread(s) to wake up and process it. */ void ckmsgq_add(ckmsgq_t *ckmsgq, void *data) { ckmsg_t *msg = ckalloc(sizeof(ckmsg_t)); @@ -185,7 +185,7 @@ void ckmsgq_add(ckmsgq_t *ckmsgq, void *data) mutex_lock(ckmsgq->lock); ckmsgq->messages++; DL_APPEND(ckmsgq->msgs, msg); - pthread_cond_signal(ckmsgq->cond); + pthread_cond_broadcast(ckmsgq->cond); mutex_unlock(ckmsgq->lock); }