Commit 8be5da3d694985b4f0076ffcec8dcb069095c5e2

Denis Ahrens 2012-12-22T17:47:10

driver-ztex: react to new work in 10ms and not 250ms

diff --git a/driver-ztex.c b/driver-ztex.c
index 41ee3b0..8ef2910 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -229,11 +229,18 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
 	applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr);
 	while (!(overflow || thr->work_restart)) {
 		count++;
-		nmsleep(250);
+
+		int sleepcount = 0;
+		while (thr->work_restart == 0 && sleepcount < 25) {
+			nmsleep(10);
+			sleepcount += 1;
+		}
+
 		if (thr->work_restart) {
 			applog(LOG_DEBUG, "%s: New work detected", ztex->repr);
 			break;
 		}
+
 		ztex_selectFpga(ztex);
 		i = libztex_readHashData(ztex, &hdata[0]);
 		if (i < 0) {