aboutsummaryrefslogtreecommitdiff
path: root/include/queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/queue.h')
-rw-r--r--include/queue.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/queue.h b/include/queue.h
index ca11614..5f2d5f4 100644
--- a/include/queue.h
+++ b/include/queue.h
@@ -1,10 +1,20 @@
#include <pthread.h>
#include <sys/queue.h>
+#include <semaphore.h>
#include "jobs.h"
+#ifndef QUEUE_H
+
+typedef enum {
+ Q_ITS_OVER = 0,
+ Q_SEM_WAIT = 1,
+} queue_state_t;
+
struct queue {
struct job_clist jobs;
+ sem_t sem;
+ queue_state_t state;
pthread_mutex_t mutex;
};
@@ -17,3 +27,7 @@ struct queue_thread {
int queue_thread_new(struct queue_thread **queue_thread, FILE *stream);
void queue_thread_free(struct queue_thread *queue_thread);
void *queue_thread_entry(void *queue_thread);
+int queue_pop(struct queue *queue, struct job **job);
+
+#define QUEUE_H
+#endif