cec: prevent possible deadlock when closing the connection in CUSBCECAdapterCommunica...
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 11 Feb 2012 20:02:32 +0000 (21:02 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 11 Feb 2012 20:02:32 +0000 (21:02 +0100)
src/lib/adapter/USBCECAdapterCommunication.cpp

index 8e0b44e58b57e72fbf440d123f1da58b1094fcb9..3b32ebd3b259af9b312c4922e09843f741472949 100644 (file)
@@ -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();
 }