]> mj.ucw.cz Git - libucw.git/commitdiff
Removed the `returned' hook.
authorMartin Mares <mj@ucw.cz>
Fri, 15 Dec 2006 13:27:44 +0000 (14:27 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 15 Dec 2006 13:27:44 +0000 (14:27 +0100)
lib/workqueue.c
lib/workqueue.h

index 1e2bcb1c2cbfd4fcbefcfa09bc7add95b6b47485..325cedf7f71950bd2c47825c25aa5d9c3f6e2987 100644 (file)
@@ -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 *
index f23198c1d3b2efa386bcd98345a2f4fe1ebdb9c6..b16a9947c31dbd9385a3e5ba5efaaae7a0a45cbe 100644 (file)
@@ -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);