1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Convert unreliable usleep calls to nmsleep calls in ztex driver.

This commit is contained in:
Con Kolivas 2012-11-18 22:21:20 +11:00
parent 9ad02fe303
commit 90d1d7b6ca

View File

@ -208,7 +208,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
if (i < 0) { if (i < 0) {
// Something wrong happened in send // Something wrong happened in send
applog(LOG_ERR, "%s: Failed to send hash data with err %d, retrying", ztex->repr, i); applog(LOG_ERR, "%s: Failed to send hash data with err %d, retrying", ztex->repr, i);
usleep(500000); nmsleep(500);
i = libztex_sendHashData(ztex, sendbuf); i = libztex_sendHashData(ztex, sendbuf);
if (i < 0) { if (i < 0) {
// And there's nothing we can do about it // And there's nothing we can do about it
@ -241,7 +241,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr); applog(LOG_DEBUG, "%s: entering poll loop", ztex->repr);
while (!(overflow || thr->work_restart)) { while (!(overflow || thr->work_restart)) {
usleep(250000); nmsleep(250);
if (thr->work_restart) { if (thr->work_restart) {
applog(LOG_DEBUG, "%s: New work detected", ztex->repr); applog(LOG_DEBUG, "%s: New work detected", ztex->repr);
break; break;
@ -251,7 +251,7 @@ static int64_t ztex_scanhash(struct thr_info *thr, struct work *work,
if (i < 0) { if (i < 0) {
// Something wrong happened in read // Something wrong happened in read
applog(LOG_ERR, "%s: Failed to read hash data with err %d, retrying", ztex->repr, i); applog(LOG_ERR, "%s: Failed to read hash data with err %d, retrying", ztex->repr, i);
usleep(500000); nmsleep(500);
i = libztex_readHashData(ztex, &hdata[0]); i = libztex_readHashData(ztex, &hdata[0]);
if (i < 0) { if (i < 0) {
// And there's nothing we can do about it // And there's nothing we can do about it