summaryrefslogtreecommitdiff
path: root/libusb/os/sunos_usb.c
diff options
context:
space:
mode:
authorAlexander Pyhalov <apyhalov@gmail.com>2018-05-24 15:06:46 +0300
committerNathan Hjelm <hjelmn@me.com>2019-04-04 22:26:40 -0600
commitfcce301c7fcfc254d8f4e67312fff944b1d15ec8 (patch)
tree94e7ccd05ed9c824389c84ef4ca055edb4b04818 /libusb/os/sunos_usb.c
parenta9b34d170a5e88a827bc30b23da919b2d796c32d (diff)
downloadlibusb-fcce301c7fcfc254d8f4e67312fff944b1d15ec8.tar.gz
transfer_lock should be released before usbi_handle_transfer_completion() call
Closes #430 Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Diffstat (limited to 'libusb/os/sunos_usb.c')
-rw-r--r--libusb/os/sunos_usb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libusb/os/sunos_usb.c b/libusb/os/sunos_usb.c
index 70e1383..ecd4aad 100644
--- a/libusb/os/sunos_usb.c
+++ b/libusb/os/sunos_usb.c
@@ -1360,9 +1360,15 @@ solaris_submit_ctrl_on_default(struct libusb_transfer *transfer)
}
usbi_dbg("Done: ctrl data bytes %d", ret);
- /* sync transfer handling */
+ /**
+ * Sync transfer handling.
+ * We should release transfer lock here and later get it back
+ * as usbi_handle_transfer_completion() takes its own transfer lock.
+ */
+ usbi_mutex_unlock(&LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer)->lock);
ret = usbi_handle_transfer_completion(LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer),
transfer->status);
+ usbi_mutex_lock(&LIBUSB_TRANSFER_TO_USBI_TRANSFER(transfer)->lock);
return (ret);
}