diff options
author | sinanmohd <sinan@sinanmohd.com> | 2024-06-21 09:46:41 +0530 |
---|---|---|
committer | sinanmohd <sinan@sinanmohd.com> | 2024-06-21 18:09:42 +0530 |
commit | 49b1faa9c128b9beb8f517bed5cccfc5cb3b0ef0 (patch) | |
tree | a7692f9ce4834172aa4c5262712841cd8aaa80a0 /include | |
parent | 36be4b06236ef60234ac8d6fe3962208c880c163 (diff) |
queue: merge matching derivations in queue
Diffstat (limited to 'include')
-rw-r--r-- | include/jobs.h | 3 | ||||
-rw-r--r-- | include/queue.h | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/jobs.h b/include/jobs.h index 85d606b..623eaea 100644 --- a/include/jobs.h +++ b/include/jobs.h @@ -1,4 +1,5 @@ #include <stdio.h> +#include <stdbool.h> #include <sys/queue.h> #ifndef JOBS_H @@ -9,6 +10,7 @@ struct output { struct job { char *name, *drv_path; + bool transitive; size_t outputs_size, outputs_filled; struct output **outputs; @@ -33,6 +35,7 @@ int job_read(FILE *stream, struct job **jobs); int jobs_init(FILE **stream); void job_free(struct job *j); +int job_parents_list_insert(struct job *job, struct job *parent); #define JOBS_H #endif diff --git a/include/queue.h b/include/queue.h index 6608ec4..c454339 100644 --- a/include/queue.h +++ b/include/queue.h @@ -1,4 +1,5 @@ #include <pthread.h> +#include <search.h> #include <semaphore.h> #include <sys/queue.h> @@ -13,6 +14,7 @@ typedef enum { struct queue { struct job_clist jobs; + struct hsearch_data *htab; sem_t sem; queue_state_t state; pthread_mutex_t mutex; @@ -27,7 +29,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); +int queue_pop(struct queue *queue, struct job **job, struct hsearch_data *htab); #define QUEUE_H #endif |