- 1 if event handling can start or continue.
- 0 if this thread must give up the events lock.
Sometimes, libusb needs to temporarily pause all event handlers, and this is the function you should use before polling file descriptors to see if this is the case.
If this function instructs your thread to give up the events lock, you should just continue the usual logic that is documented in Multi-threaded applications and asynchronous I/O. On the next iteration, your thread will fail to obtain the events lock, and will hence become an event waiter.
This function should be called while the events lock is held: you don't need to worry about the results of this function if your thread is not the current event handler.