Avoid a race between libusb_submit_transfer and libusb_free_transfer.
The tail end of libusb_submit_transfer assumes that the transfer object is still valid. It may in fact have already been freed by the transfer completion callback if that call occurs on a different thread. As a simply workaround (since the libusb code will be going away soon) this patch simply posts the transfer deletion back to the thread where libusb_submit_transfer is called so that they are serialized. BUG=487712 Review URL: https://codereview.chromium.org/1126203008 Cr-Commit-Position: refs/heads/master@{#329953}
Showing
Please register or sign in to comment