mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Add a small amount to the usb timeout before cancelling to allow for a regular usb polling interval to pass.
This commit is contained in:
parent
08d8612f68
commit
03ad59f287
@ -2227,7 +2227,9 @@ static int callback_wait(struct cgpu_info *cgpu, struct usb_transfer *ut, int *t
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
cgtime(&tv_now);
|
cgtime(&tv_now);
|
||||||
ms_to_timespec(&ts_end, timeout);
|
/* Add enough to the timeout to allow for a normal USB polling interval
|
||||||
|
* of 1ms to pass. */
|
||||||
|
ms_to_timespec(&ts_end, timeout + 2);
|
||||||
timeval_to_spec(&ts_now, &tv_now);
|
timeval_to_spec(&ts_now, &tv_now);
|
||||||
timeraddspec(&ts_end, &ts_now);
|
timeraddspec(&ts_end, &ts_now);
|
||||||
ret = pthread_cond_timedwait(&ut->cond, &ut->mutex, &ts_end);
|
ret = pthread_cond_timedwait(&ut->cond, &ut->mutex, &ts_end);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user