diff options
author | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-08-18 12:58:57 -0700 |
---|---|---|
committer | Chris Dickens <christopher.a.dickens@gmail.com> | 2020-08-18 12:58:57 -0700 |
commit | b484f841a55e7645ff2e20cfd3b8f36be4e2a4a0 (patch) | |
tree | 57e529f6940a8abb1a898f1aa80b0c84c76ef0cf /libusb/io.c | |
parent | 6baa3239baf6d2b3a910ba720f63e7edcc0e2740 (diff) | |
download | libusb-b484f841a55e7645ff2e20cfd3b8f36be4e2a4a0.tar.gz |
Documentation: Add a note regarding the execution context of callbacks
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>
Diffstat (limited to 'libusb/io.c')
-rw-r--r-- | libusb/io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libusb/io.c b/libusb/io.c index 3b1a513..b95c382 100644 --- a/libusb/io.c +++ b/libusb/io.c @@ -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. |