Documentation: Add a note regarding the execution context of callbacks
authorChris Dickens <christopher.a.dickens@gmail.com>
Tue, 18 Aug 2020 19:58:57 +0000 (12:58 -0700)
committerChris Dickens <christopher.a.dickens@gmail.com>
Tue, 18 Aug 2020 19:58:57 +0000 (12:58 -0700)
Make it more clear that callbacks are only called when
libusb_handle_events() is called and that all callbacks will be called
on the same thread calling that function.

Closes #349

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/io.c
libusb/version_nano.h

index 3b1a513..b95c382 100644 (file)
@@ -544,7 +544,14 @@ if (r == 0 && actual_length == sizeof(data)) {
  * application must call into when libusb has work do to. This gives libusb
  * the opportunity to reap pending transfers, invoke callbacks, etc.
  *
- * There are 2 different approaches to dealing with libusb_handle_events:
+ * \note
+ * All event handling is performed by whichever thread calls the
+ * libusb_handle_events() function. libusb does not invoke any callbacks
+ * outside of this context. Consequently, any callbacks will be run on the
+ * thread that calls the libusb_handle_events() function.
+ *
+ * When to call the libusb_handle_events() function depends on which model
+ * your application decides to use. The 2 different approaches:
  *
  * -# Repeatedly call libusb_handle_events() in blocking mode from a dedicated
  *    thread.
index 7636904..0782b51 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11542
+#define LIBUSB_NANO 11543