Use sync usb transfers in lowmem mode.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
diff --git a/cgminer.c b/cgminer.c
index e59a46c..9a064c0 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -138,7 +138,7 @@ static bool opt_submit_stale = true;
static int opt_shares;
bool opt_fail_only;
static bool opt_fix_protocol;
-static bool opt_lowmem;
+bool opt_lowmem;
bool opt_autofan;
bool opt_autoengine;
bool opt_noadl;
diff --git a/miner.h b/miner.h
index 685a4fb..28798db 100644
--- a/miner.h
+++ b/miner.h
@@ -978,6 +978,7 @@ extern char *opt_kernel_path;
extern char *opt_socks_proxy;
extern char *cgminer_path;
extern bool opt_fail_only;
+extern bool opt_lowmem;
extern bool opt_autofan;
extern bool opt_autoengine;
extern bool use_curses;
diff --git a/usbutils.c b/usbutils.c
index d6726ce..991ea75 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2453,7 +2453,7 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
/* Avoid any async transfers during shutdown to allow the polling
* thread to be shut down after all existing transfers are complete */
- if (unlikely(cgpu->shutdown))
+ if (opt_lowmem || cgpu->shutdown)
return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout);
init_usb_transfer(&ut);