Remove include added by editor; Make sure to call pthread_cond_broadcast after pushing to mq in order to unblock threads;

This commit is contained in:
Nathan Fisher 2023-10-05 12:50:26 -04:00
parent ccb742e80e
commit 5a769bc36c
2 changed files with 1 additions and 1 deletions

View file

@ -39,7 +39,6 @@
#include <limits.h> // PATH_MAX
#include <stddef.h> // size_t
#include <stdint.h> // uint<x>_t
#include <sys/syslimits.h>
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sha.h>

1
mq.c
View file

@ -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;
}