mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Use the cgsleep reentrant function to sleep for bflsc between read results to account for time taken to perform reads.
This commit is contained in:
parent
3c707202cf
commit
e56c9a5d3b
@ -1401,6 +1401,8 @@ static void *bflsc_get_results(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (sc_info->shutdown == false) {
|
while (sc_info->shutdown == false) {
|
||||||
|
struct timespec ts_start;
|
||||||
|
|
||||||
if (bflsc->usbinfo.nodev)
|
if (bflsc->usbinfo.nodev)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -1425,6 +1427,7 @@ static void *bflsc_get_results(void *userdata)
|
|||||||
goto utsura;
|
goto utsura;
|
||||||
|
|
||||||
cgtime(&(sc_info->sc_devs[dev].last_check_result));
|
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);
|
readok = bflsc_qres(bflsc, buf, sizeof(buf), dev, &err, &amount, false);
|
||||||
if (err < 0 || (!readok && amount != BFLSC_QRES_LEN) || (readok && amount < 1)) {
|
if (err < 0 || (!readok && amount != BFLSC_QRES_LEN) || (readok && amount < 1)) {
|
||||||
@ -1441,7 +1444,7 @@ static void *bflsc_get_results(void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
utsura:
|
utsura:
|
||||||
nmsleep(sc_info->results_sleep_time);
|
cgsleep_ms_r(&ts_start, sc_info->results_sleep_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user