From: Lars Op den Kamp Date: Sat, 11 Feb 2012 20:02:32 +0000 (+0100) Subject: cec: prevent possible deadlock when closing the connection in CUSBCECAdapterCommunica... X-Git-Tag: upstream/2.2.0~1^2~35^2~99 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c02a2b2e50e1d35379b6036fc86e3d2150a8fb4f;p=deb_libcec.git cec: prevent possible deadlock when closing the connection in CUSBCECAdapterCommunication::Close() --- 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(); }