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

Add cancellable transfers correctly to the ct_list

This commit is contained in:
Con Kolivas 2013-10-25 08:43:55 +11:00
parent e22035f024
commit 7b5884caa5

View File

@ -96,6 +96,8 @@
/* Keep a global counter of how many async transfers are in place to avoid /* Keep a global counter of how many async transfers are in place to avoid
* shutting down the usb polling thread while they exist. */ * shutting down the usb polling thread while they exist. */
int cgusb_transfers; int cgusb_transfers;
/* Linked list of all cancellable transfers. */
static struct list_head ct_list; static struct list_head ct_list;
#ifdef USE_BFLSC #ifdef USE_BFLSC
@ -2327,7 +2329,7 @@ static int usb_submit_transfer(struct usb_transfer *ut, struct libusb_transfer *
if (cancellable) { if (cancellable) {
ut->cancellable = true; ut->cancellable = true;
INIT_LIST_HEAD(&ut->list); INIT_LIST_HEAD(&ut->list);
list_add(&ct_list, &ut->list); list_add(&ut->list, &ct_list);
} else } else
ut->cancellable = false; ut->cancellable = false;
cg_wunlock(&cgusb_fd_lock); cg_wunlock(&cgusb_fd_lock);