From: Martin Mares Date: Fri, 15 Dec 2006 13:27:44 +0000 (+0100) Subject: Removed the `returned' hook. X-Git-Tag: holmes-import~507^2~6 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ba4ac072b6c5eced54aa45ee85fc7e97cb224955;p=libucw.git Removed the `returned' hook. --- 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);