Commit 67a9af68a153c3d91432b4bbfda7de33f35c8dfe

Con Kolivas 2012-12-08T21:53:06

Hash_pop should signal further waiters on its own pthread conditional in case there are multiple waiters.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cgminer.c b/cgminer.c
index d7f0020..b4b30ff 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4994,7 +4994,12 @@ static struct work *hash_pop(void)
 	HASH_DEL(staged_work, work);
 	if (work_rollable(work))
 		staged_rollable--;
+
+	/* Signal the getwork scheduler to look for more work */
 	pthread_cond_signal(&gws_cond);
+
+	/* Signal hash_pop again in case there are mutliple hash_pop waiters */
+	pthread_cond_signal(&getq->cond);
 	mutex_unlock(stgd_lock);
 
 	return work;