Increase the work queue at the top end if we've hit the bottom as well.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/cgminer.c b/cgminer.c
index 4fd9106..0d2b239 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -6281,6 +6281,7 @@ static void pool_resus(struct pool *pool)
}
static bool work_filled;
+static bool work_emptied;
/* If this is called non_blocking, it will return NULL for work so that must
* be handled. */
@@ -6297,6 +6298,7 @@ static struct work *hash_pop(bool blocking)
opt_queue++;
work_filled = false;
}
+ work_emptied = true;
if (!blocking)
goto out_unlock;
do {
@@ -8971,6 +8973,10 @@ begin_bench:
/* Wait until hash_pop tells us we need to create more work */
if (ts > max_staged) {
+ if (work_emptied) {
+ opt_queue++;
+ work_emptied = false;
+ }
work_filled = true;
pthread_cond_wait(&gws_cond, stgd_lock);
ts = __total_staged();
@@ -8981,6 +8987,10 @@ begin_bench:
/* Keeps slowly generating work even if it's not being
* used to keep last_getwork incrementing and to see
* if pools are still alive. */
+ if (work_emptied) {
+ opt_queue++;
+ work_emptied = false;
+ }
work_filled = true;
work = hash_pop(false);
if (work)