summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Kalinich (GitHub) <AKalinich@luxoft.com>2020-10-05 17:50:11 -0400
committerGitHub <noreply@github.com>2020-10-05 17:50:11 -0400
commit91f359af3499d6b8463274c9307500b49e2a3639 (patch)
tree08622b530ac23ec5c01ec892a1871d3614031a4a
parent0d53e41272c5da5e3c73ab9f3121cb95603f68fe (diff)
downloadsdl_core-91f359af3499d6b8463274c9307500b49e2a3639.tar.gz
Fix dead lock in usb connection (#3494)
In a while called method locks mutex for protecting data and if USB connection is failed it means that method will call and will try to lock the same mutex again. That's why this mutex should be recursive.
-rw-r--r--src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
index 0fb9c599c7..4d0fa70f70 100644
--- a/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
+++ b/src/components/transport_manager/include/transport_manager/usb/libusb/usb_connection.h
@@ -86,7 +86,7 @@ class UsbConnection : public Connection {
std::list<protocol_handler::RawMessagePtr> out_messages_;
protocol_handler::RawMessagePtr current_out_message_;
- sync_primitives::Lock out_messages_mutex_;
+ sync_primitives::RecursiveLock out_messages_mutex_;
size_t bytes_sent_;
bool disconnecting_;
bool waiting_in_transfer_cancel_;