Commit 09dbd616e202ecbe82c45b032c2382d540ed19a3

Con Kolivas 2013-08-19T13:57:36

Prepare sleep time on bflsc if no dev needs work yet to avoid busy waiting.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/driver-bflsc.c b/driver-bflsc.c
index 6df5fca..476742f 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -1423,11 +1423,11 @@ static void *bflsc_get_results(void *userdata)
 		if (bflsc->usbinfo.nodev)
 			return NULL;
 
+		cgsleep_prepare_r(&ts_start);
 		if (dev == -1)
 			goto utsura;
 
 		cgtime(&(sc_info->sc_devs[dev].last_check_result));
-		cgsleep_prepare_r(&ts_start);
 
 		readok = bflsc_qres(bflsc, buf, sizeof(buf), dev, &err, &amount, false);
 		if (err < 0 || (!readok && amount != BFLSC_QRES_LEN) || (readok && amount < 1)) {