From 5a769bc36c89c04540b8b9d608ce6defb2e2b651 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Thu, 5 Oct 2023 12:50:26 -0400 Subject: [PATCH] Remove include added by editor; Make sure to call `pthread_cond_broadcast` after pushing to mq in order to unblock threads; --- haggis.c | 1 - mq.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/haggis.c b/haggis.c index 2fef2a7..d604323 100644 --- a/haggis.c +++ b/haggis.c @@ -39,7 +39,6 @@ #include // PATH_MAX #include // size_t #include // uint_t -#include #if defined(__FreeBSD__) || defined(__DragonFly__) #include diff --git a/mq.c b/mq.c index a41af1c..5992a76 100644 --- a/mq.c +++ b/mq.c @@ -81,6 +81,7 @@ int haggis_mq_push(haggis_mq *queue, haggis_msg *msg) { queue->tail = msg; } queue->count++; + pthread_cond_broadcast(&queue->cond); pthread_mutex_unlock(&queue->mutex); return 0; }