]> mj.ucw.cz Git - libucw.git/blobdiff - lib/workqueue.c
Merged mainline with parallel shep-reap:
[libucw.git] / lib / workqueue.c
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 *