From ba4ac072b6c5eced54aa45ee85fc7e97cb224955 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 15 Dec 2006 14:27:44 +0100 Subject: [PATCH] Removed the `returned' hook. --- lib/workqueue.c | 19 +++++++------------ lib/workqueue.h | 1 - 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/workqueue.c b/lib/workqueue.c index 1e2bcb1c..325cedf7 100644 --- a/lib/workqueue.c +++ b/lib/workqueue.c @@ -202,18 +202,13 @@ work_submit(struct work_queue *q, struct work *w) static struct work * work_do_wait(struct work_queue *q, int try) { - while (q->nr_running) - { - struct work *w = (try ? raw_queue_try_get : raw_queue_get)(&q->finished); - if (!w) - return NULL; - q->nr_running--; - if (w->returned) - w->returned(q, w); - else - return w; - } - return NULL; + if (!q->nr_running) + return NULL; + struct work *w = (try ? raw_queue_try_get : raw_queue_get)(&q->finished); + if (!w) + return NULL; + q->nr_running--; + return w; } struct work * diff --git a/lib/workqueue.h b/lib/workqueue.h index f23198c1..b16a9947 100644 --- a/lib/workqueue.h +++ b/lib/workqueue.h @@ -73,7 +73,6 @@ struct work { // A single request uns priority; struct work_queue *reply_to; // Where to queue the request when it's finished void (*go)(struct worker_thread *t, struct work *w); // Called inside the worker thread - void (*returned)(struct work_queue *q, struct work *w); // Called when returned back, NULL if work_wait should return }; void worker_pool_init(struct worker_pool *p); -- 2.39.2