- 0 if the lock was obtained successfully.
- 1 if the lock was not obtained. (i.e. another thread holds the lock)
This lock is used to ensure that only one thread is monitoring libusb event sources at any one time.
You only need to use this lock if you are developing an application which calls poll() or select() on libusb's file descriptors directly. If you stick to libusb's event handling loop functions (e.g. libusb_handle_events) then you do not need to be concerned with this locking.
While holding this lock, you are trusted to actually be handling events. If you are no longer handling events, you must call libusb_unlock_events as soon as possible.