This flag will be useful in a subsequent commit that further
consolidates event handling.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
*/
void usbi_fd_notification(struct libusb_context *ctx)
{
+ /* record that there is a new poll fd */
+ usbi_mutex_lock(&ctx->event_data_lock);
+ ctx->fd_notify = 1;
+ usbi_mutex_unlock(&ctx->event_data_lock);
+
+ /* signal the event pipe to interrupt event handlers */
usbi_signal_event(ctx);
}
* in order to safely close a device. Protected by event_data_lock. */
unsigned int device_close;
+ /* A flag that is set when we want to interrupt event handling, in order to
+ * pick up a new fd for polling. Protected by event_data_lock. */
+ unsigned int fd_notify;
+
/* used to wait for event completion in threads other than the one that is
* event handling */
usbi_mutex_t event_waiters_lock;
-#define LIBUSB_NANO 10936
+#define LIBUSB_NANO 10937