Commit b4bc5e2b13ec1d924b4652f65e47ddb4a0c8a9da

Con Kolivas 2013-04-16T22:57:55

Check for work restart after disable in the hash queued work loop since it may be a long time before we re-enable a device.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/cgminer.c b/cgminer.c
index f2840f0..debea35 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5910,13 +5910,13 @@ void hash_queued_work(struct thr_info *mythr)
 			memcpy(&tv_start, &tv_end, sizeof(struct timeval));
 		}
 
+		if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED))
+			mt_disable(mythr, thr_id, drv);
+
 		if (unlikely(mythr->work_restart)) {
 			flush_queue(cgpu);
 			drv->flush_work(cgpu);
 		}
-
-		if (unlikely(mythr->pause || cgpu->deven != DEV_ENABLED))
-			mt_disable(mythr, thr_id, drv);
 	}
 }