From: Lars Op den Kamp Date: Mon, 9 Dec 2013 22:22:17 +0000 (+0100) Subject: separate mutex for CUSBCECAdapterCommunication::MarkAsWaiting() X-Git-Tag: upstream/2.2.0~1^2~3^2~24 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f7773e4047c9030aa02418ab33319ab14ebdacca;p=deb_libcec.git separate mutex for CUSBCECAdapterCommunication::MarkAsWaiting() --- diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp index 2e9c790..0373595 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.cpp @@ -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; } } diff --git a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h index ba5d7ca..bac9437 100644 --- a/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h +++ b/src/lib/adapter/Pulse-Eight/USBCECAdapterCommunication.h @@ -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