separate mutex for CUSBCECAdapterCommunication::MarkAsWaiting()
authorLars Op den Kamp <lars@opdenkamp.eu>
Mon, 9 Dec 2013 22:22:17 +0000 (23:22 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Mon, 9 Dec 2013 22:22:17 +0000 (23:22 +0100)
src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp
src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h

index 2e9c790a7342cce914c28eb29c4e8ba031c33712..037359599be766fce14a87779e3405318393927f 100644 (file)
@@ -304,6 +304,7 @@ bool CUSBCECAdapterCommunication::HandlePoll(const CCECAdapterMessage &msg)
     m_lastPollDestination = msg.Destination();
     if (msg.Destination() < CECDEVICE_BROADCAST)
     {
+      CLockObject waitingLock(m_waitingMutex);
       if (!m_bWaitingForAck[msg.Destination()] && !msg.IsEOM())
       {
         if (m_callback)
@@ -328,7 +329,7 @@ void CUSBCECAdapterCommunication::MarkAsWaiting(const cec_logical_address dest)
   /* mark as waiting for an ack from the destination */
   if (dest < CECDEVICE_BROADCAST)
   {
-    CLockObject lock(m_mutex);
+    CLockObject waitingLock(m_waitingMutex);
     m_bWaitingForAck[dest] = true;
   }
 }
index ba5d7ca65bd40a4cc81e29fd3ea92a1ccb4ac87f..bac9437917cd4d06d3437aac331cf7568a426991 100644 (file)
@@ -182,6 +182,7 @@ namespace CEC
     CUSBCECAdapterCommands *                     m_commands;             /**< commands that can be sent to the adapter */
     CCECAdapterMessageQueue *                    m_adapterMessageQueue;  /**< the incoming and outgoing message queue */
     cec_logical_addresses                        m_logicalAddresses;     /**< the logical address list that this instance is using */
+    PLATFORM::CMutex                             m_waitingMutex;
   };
 
   class CAdapterEepromWriteThread : public PLATFORM::CThread