summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2014-08-25 23:26:51 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2014-08-27 01:49:03 -0700
commita3a4806d494b8ff3dd213d5eb408b657bcdd47f0 (patch)
tree9f4edf4e082d6a1fa187fe05eef48c950eddbd38
parente11525c66c7dd2db466c8f5785ff0b37d6a99ec9 (diff)
downloadlibusb-a3a4806d494b8ff3dd213d5eb408b657bcdd47f0.tar.gz
usbi_handle_transfer_completion: Remove signal to event waiters
usbi_handle_transfer_completion() is only called by backends when handling transfer completion. The backend can only make this call whilst holding the events lock, therefore it is pointless to send this signal. Any threads waiting to be signaled will be woken up and will either find that an event handler is still active or will try to obtain the events lock and be blocked. Event waiters are automatically signaled in libusb_unlock_events(), so when the backend is done handling events it will release the lock and wake up any waiters. At this point the events lock wll be free, which is the only time waking up waiters makes sense. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
-rw-r--r--libusb/io.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/libusb/io.c b/libusb/io.c
index b9ca767..8377a5e 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -1599,9 +1599,6 @@ int usbi_handle_transfer_completion(struct usbi_transfer *itransfer,
* this point. */
if (flags & LIBUSB_TRANSFER_FREE_TRANSFER)
libusb_free_transfer(transfer);
- usbi_mutex_lock(&ctx->event_waiters_lock);
- usbi_cond_broadcast(&ctx->event_waiters_cond);
- usbi_mutex_unlock(&ctx->event_waiters_lock);
libusb_unref_device(handle->dev);
return 0;
}