mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-03 10:35:03 +00:00
Do not use locking on usb callback function pthread signalling to prevent deadlock with libusb's own event lock.
This commit is contained in:
parent
d2d7a7468e
commit
8d1604a2e3
@ -2248,9 +2248,7 @@ static void LIBUSB_CALL transfer_callback(struct libusb_transfer *transfer)
|
|||||||
{
|
{
|
||||||
struct usb_transfer *ut = transfer->user_data;
|
struct usb_transfer *ut = transfer->user_data;
|
||||||
|
|
||||||
mutex_lock(&ut->mutex);
|
|
||||||
pthread_cond_signal(&ut->cond);
|
pthread_cond_signal(&ut->cond);
|
||||||
mutex_unlock(&ut->mutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for callback function to tell us it has finished the USB transfer, but
|
/* Wait for callback function to tell us it has finished the USB transfer, but
|
||||||
@ -2272,7 +2270,6 @@ static int callback_wait(struct usb_transfer *ut, int *transferred, unsigned int
|
|||||||
libusb_cancel_transfer(transfer);
|
libusb_cancel_transfer(transfer);
|
||||||
|
|
||||||
/* Now wait for the callback function to be invoked. */
|
/* Now wait for the callback function to be invoked. */
|
||||||
mutex_lock(&ut->mutex);
|
|
||||||
pthread_cond_wait(&ut->cond, &ut->mutex);
|
pthread_cond_wait(&ut->cond, &ut->mutex);
|
||||||
}
|
}
|
||||||
ret = transfer->status;
|
ret = transfer->status;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user