summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libusb/core.c6
-rw-r--r--libusb/libusbi.h4
-rw-r--r--libusb/version_nano.h2
3 files changed, 11 insertions, 1 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 32db2a6..13100da 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -1215,6 +1215,12 @@ int usbi_clear_event(struct libusb_context *ctx)
*/
void usbi_fd_notification(struct libusb_context *ctx)
{
+ /* record that there is a new poll fd */
+ usbi_mutex_lock(&ctx->event_data_lock);
+ ctx->fd_notify = 1;
+ usbi_mutex_unlock(&ctx->event_data_lock);
+
+ /* signal the event pipe to interrupt event handlers */
usbi_signal_event(ctx);
}
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index ebcc0d3..cb24cf9 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -294,6 +294,10 @@ struct libusb_context {
* in order to safely close a device. Protected by event_data_lock. */
unsigned int device_close;
+ /* A flag that is set when we want to interrupt event handling, in order to
+ * pick up a new fd for polling. Protected by event_data_lock. */
+ unsigned int fd_notify;
+
/* used to wait for event completion in threads other than the one that is
* event handling */
usbi_mutex_t event_waiters_lock;
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 73d2ed1..9624091 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10936
+#define LIBUSB_NANO 10937