aboutsummaryrefslogtreecommitdiff
path: root/include/queue.h
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-03 19:16:21 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-03 22:28:45 +0530
commit5602a17e4c916c1fe90a0025fbdceb0621e2e9ba (patch)
treee454fdaba66a9a0d34ca2ecbde5a978ecb9f29b5 /include/queue.h
parent4a00927f139c545288c1ae2d197d4fdc8fa36051 (diff)
solver_greedy: init
Diffstat (limited to 'include/queue.h')
-rw-r--r--include/queue.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/queue.h b/include/queue.h
index c81f062..cfc67ef 100644
--- a/include/queue.h
+++ b/include/queue.h
@@ -1,7 +1,7 @@
#include <pthread.h>
-#include <stdint.h>
#include <search.h>
#include <semaphore.h>
+#include <stdint.h>
#include <sys/queue.h>
#include "htab.h"
@@ -17,12 +17,14 @@ typedef enum {
struct queue {
struct job_clist jobs;
- struct htab *htab;
- struct jobid *jobid;
sem_t sem;
queue_state_t state;
pthread_mutex_t mutex;
- uint64_t age;
+ struct htab *htab;
+
+ /* solver */
+ struct jobid *jobid;
+ int32_t resources;
};
struct queue_thread {
@@ -35,6 +37,7 @@ 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, struct htab *htab);
+int queue_isempty(struct job_clist *jobs);
#define QUEUE_H
#endif