diff options
author | Pete Batard <pbatard@gmail.com> | 2010-03-18 01:14:51 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-03-18 01:17:51 +0000 |
commit | 386dc50b6f85c53dcee40f5e67d9760c19aadc79 (patch) | |
tree | d0737cb598cadd7e69b7315b2955908d0dd5a2e9 | |
parent | 67f473c804101d26e8416144a1110207fda6c3c1 (diff) | |
download | libusb-386dc50b6f85c53dcee40f5e67d9760c19aadc79.tar.gz |
r213 fixed missing mutex for transfer access (Graeme Gill)c203
-rw-r--r-- | libusb/os/windows_usb.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 4b58b87..b3466b7 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -2062,6 +2062,7 @@ static int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, // Because a Windows OVERLAPPED is used for poll emulation, // a pollable fd is created and stored with each transfer + usbi_mutex_lock(&ctx->flying_transfers_lock); list_for_each_entry(transfer, &ctx->flying_transfers, list, struct usbi_transfer) { transfer_priv = usbi_transfer_get_os_priv(transfer); if (transfer_priv->pollable_fd.fd == fds[i].fd) { @@ -2069,6 +2070,7 @@ static int windows_handle_events(struct libusb_context *ctx, struct pollfd *fds, break; } } + usbi_mutex_unlock(&ctx->flying_transfers_lock); if (found) { // Handle async requests that completed synchronously first |