Commit fd28d9f4076b003159bc3b9fe293d9718c7d08ad

Con Kolivas 2012-09-24T09:03:27

Ignore any pings pushed to the worker threads if the thread is still paused to prevent it being enabled and disabled repeatedly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/cgminer.c b/cgminer.c
index 7645ff2..bb522f3 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4353,7 +4353,9 @@ static void mt_disable(struct thr_info *mythr, const int thr_id,
 	mythr->rolling = mythr->cgpu->rolling = 0;
 	applog(LOG_DEBUG, "Popping wakeup ping in miner thread");
 	thread_reportout(mythr);
-	tq_pop(mythr->q, NULL); /* Ignore ping that's popped */
+	do {
+		tq_pop(mythr->q, NULL); /* Ignore ping that's popped */
+	} while (mythr->pause);
 	thread_reportin(mythr);
 	applog(LOG_WARNING, "Thread %d being re-enabled", thr_id);
 	if (api->thread_enable)