Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/libusb/libusb_send_event.patch

Issue 16316004: Separate usb device handle from usb device. (deprecate) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the threading mess Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libusb/README.chromium ('k') | third_party/libusb/src/libusb/core.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libusb/libusb_send_event.patch
diff --git a/third_party/libusb/libusb_send_event.patch b/third_party/libusb/libusb_send_event.patch
new file mode 100644
index 0000000000000000000000000000000000000000..ba84f7b6913ad669c984b8289e65d77550a584c4
--- /dev/null
+++ b/third_party/libusb/libusb_send_event.patch
@@ -0,0 +1,36 @@
+diff --git a/third_party/libusb/src/libusb/core.c b/third_party/libusb/src/libusb/core.c
+index a91c77b..5512bd8 100644
+--- a/third_party/libusb/src/libusb/core.c
++++ b/third_party/libusb/src/libusb/core.c
+@@ -1664,6 +1664,15 @@ void API_EXPORTED libusb_exit(struct libusb_context *ctx)
+ free(ctx);
+ }
+
++/*
++ * Interrupt libusb_handle_events_timeout_completed.
++ */
++void API_EXPORTED libusb_send_event(struct libusb_context *ctx) {
++ unsigned char dummy = 1;
++ USBI_GET_CONTEXT(ctx);
++ usbi_write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy));
++}
++
+ /** \ingroup misc
+ * Check if the running library has a given capability.
+ *
+diff --git a/third_party/libusb/src/libusb/libusb.h b/third_party/libusb/src/libusb/libusb.h
+index beff229..fdf0b4d 100644
+--- a/third_party/libusb/src/libusb/libusb.h
++++ b/third_party/libusb/src/libusb/libusb.h
+@@ -1350,6 +1350,11 @@ int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx);
+ int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx,
+ struct timeval *tv);
+
++/**
++ * Interrupt libusb_handle_events_timeout_completed.
++ */
++void LIBUSB_CALL libusb_send_event(struct libusb_context *ctx);
++
+ /** \ingroup poll
+ * File descriptor for polling
+ */
« no previous file with comments | « third_party/libusb/README.chromium ('k') | third_party/libusb/src/libusb/core.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698