diff options
Diffstat (limited to 'src/worker_queue.c')
-rw-r--r-- | src/worker_queue.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/worker_queue.c b/src/worker_queue.c index b0dda38..9154e24 100644 --- a/src/worker_queue.c +++ b/src/worker_queue.c @@ -16,7 +16,7 @@ struct worker { pthread_t thread; int fd; - STAILQ_ENTRY(worker) entries; + SIMPLEQ_ENTRY(worker) entries; }; int worker_create(struct worker **_entry, int fd) @@ -49,38 +49,38 @@ int worker_get_fd(const struct worker *entry) void worker_queue_create(struct worker_queue *queue) { - STAILQ_INIT(queue); + SIMPLEQ_INIT(queue); } void worker_queue_destroy(struct worker_queue *queue) { - struct worker *entry1 = STAILQ_FIRST(queue); + struct worker *entry1 = SIMPLEQ_FIRST(queue); while (entry1) { - struct worker *entry2 = STAILQ_NEXT(entry1, entries); + struct worker *entry2 = SIMPLEQ_NEXT(entry1, entries); worker_destroy(entry1); entry1 = entry2; } - STAILQ_INIT(queue); + SIMPLEQ_INIT(queue); } int worker_queue_is_empty(const struct worker_queue *queue) { - return STAILQ_EMPTY(queue); + return SIMPLEQ_EMPTY(queue); } void worker_queue_add_first(struct worker_queue *queue, struct worker *entry) { - STAILQ_INSERT_HEAD(queue, entry, entries); + SIMPLEQ_INSERT_HEAD(queue, entry, entries); } void worker_queue_add_last(struct worker_queue *queue, struct worker *entry) { - STAILQ_INSERT_HEAD(queue, entry, entries); + SIMPLEQ_INSERT_HEAD(queue, entry, entries); } struct worker *worker_queue_remove_first(struct worker_queue *queue) { - struct worker *entry = STAILQ_FIRST(queue); - STAILQ_REMOVE_HEAD(queue, entries); + struct worker *entry = SIMPLEQ_FIRST(queue); + SIMPLEQ_REMOVE_HEAD(queue, entries); return entry; } |