From c02a2b2e50e1d35379b6036fc86e3d2150a8fb4f Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sat, 11 Feb 2012 21:02:32 +0100 Subject: [PATCH] cec: prevent possible deadlock when closing the connection in CUSBCECAdapterCommunication::Close() --- src/lib/adapter/USBCECAdapterCommunication.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 8e0b44e..3b32ebd 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -174,9 +174,11 @@ bool CUSBCECAdapterCommunication::Open(IAdapterCommunicationCallback *cb, uint32 void CUSBCECAdapterCommunication::Close(void) { SetAckMask(0); - CLockObject lock(m_mutex); - m_bHasData = true; - m_rcvCondition.Broadcast(); + { + CLockObject lock(m_mutex); + m_bHasData = true; + m_rcvCondition.Broadcast(); + } StopThread(); } -- 2.34.1