Commit 720032dacd5567773d72cbc5c416289a29d8a70c

Con Kolivas 2011-07-27T15:11:57

Make sure to decrease queued count if we discard the work.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/main.c b/main.c
index d148d1d..5f00b47 100644
--- a/main.c
+++ b/main.c
@@ -2378,6 +2378,7 @@ retry:
 		goto retry;
 	}
 
+	dec_queued();
 	if (stale_work(work_heap)) {
 		discard_work(work_heap);
 		goto retry;
@@ -2387,7 +2388,6 @@ retry:
 	/* If we make it here we have succeeded in getting fresh work */
 	if (pool_tclear(pool, &pool->idle))
 		pool_resus(pool);
-	dec_queued();
 
 	memcpy(work, work_heap, sizeof(*work));