This avoids a race between the user checking for active event handler
and then blocking on the condition variable
* this point. */
if (flags & LIBUSB_TRANSFER_FREE_TRANSFER)
libusb_free_transfer(transfer);
+ pthread_mutex_lock(&event_waiters_lock);
pthread_cond_broadcast(&event_waiters_cond);
+ pthread_mutex_unlock(&event_waiters_lock);
}
/* Similar to usbi_handle_transfer_completion() but exclusively for transfers