Commit 6a91027f50c3a020d25eeeb550e85ab34a743b84

Con Kolivas 2013-11-30T10:14:44

Use sync usb transfers in lowmem mode.

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);