From 685c2acecd439e3fe4b5e8b803710c6a37ea5f59 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Thu, 17 Oct 2013 20:03:31 +1100 Subject: [PATCH] Speed up polling repeat again in usb poll thread and handle async after the message to disable polling is complete. --- cgminer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cgminer.c b/cgminer.c index c2a91338..4dbc57d4 100644 --- a/cgminer.c +++ b/cgminer.c @@ -7795,12 +7795,16 @@ static void probe_pools(void) #ifdef USE_USBUTILS static void *libusb_poll_thread(void __maybe_unused *arg) { - struct timeval tv_end = {1, 0}; + struct timeval tv_end = {0, 100000}; RenameThread("usbpoll"); while (usb_polling) libusb_handle_events_timeout_completed(NULL, &tv_end, NULL); + /* One longer poll on shut down to enable drivers to hopefully cleanly + * shut down. */ + tv_end.tv_sec = 1; + libusb_handle_events_timeout_completed(NULL, &tv_end, NULL); return NULL; }