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:14:51 +0000 |
commit | 8978ed4f59b2643ce9fe8adfe0be35595152c26e (patch) | |
tree | 88ece0fa065f3bd8252fd68887a35ea18768c80b | |
parent | 7c8348fff2fff1dcaa1d36672a76200ca8d2cb79 (diff) | |
download | libusb-8978ed4f59b2643ce9fe8adfe0be35595152c26e.tar.gz |
fixed missing mutex for transfer access (Graeme Gill)r213
-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 0cec76a..e21a984 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -1923,6 +1923,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) { @@ -1930,6 +1931,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 |