From: Lars Op den Kamp Date: Sat, 29 Oct 2011 21:07:37 +0000 (+0200) Subject: cec: dropped second mutex in CAdapterCommunication. it's all called from 1 thread now X-Git-Tag: upstream/2.2.0~1^2~186 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b9abf9202e8d5971805dd63600990673227034a3;p=deb_libcec.git cec: dropped second mutex in CAdapterCommunication. it's all called from 1 thread now --- diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index 0439100..003d987 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -60,7 +60,6 @@ CAdapterCommunication::~CAdapterCommunication(void) bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38400 */, uint32_t iTimeoutMs /* = 10000 */) { - CLockObject lock(&m_commMutex); if (!m_port) { m_controller->AddLog(CEC_LOG_ERROR, "port is NULL"); @@ -101,7 +100,6 @@ bool CAdapterCommunication::Open(const char *strPort, uint16_t iBaudRate /* = 38 void CAdapterCommunication::Close(void) { - CLockObject lock(&m_commMutex); StopThread(); m_rcvCondition.Broadcast(); @@ -113,7 +111,7 @@ void *CAdapterCommunication::Process(void) while (!IsStopped()) { - ReadFromDevice(100); + ReadFromDevice(500); WriteNextCommand(); Sleep(5); } @@ -123,7 +121,6 @@ void *CAdapterCommunication::Process(void) bool CAdapterCommunication::ReadFromDevice(uint32_t iTimeout) { - CLockObject lock(&m_commMutex); int32_t iBytesRead; uint8_t buff[1024]; if (!m_port) @@ -154,7 +151,6 @@ void CAdapterCommunication::AddData(uint8_t *data, uint8_t iLen) void CAdapterCommunication::WriteNextCommand(void) { - CLockObject lock(&m_commMutex); CCECAdapterMessage msg; if (m_outBuffer.Pop(msg)) { diff --git a/src/lib/AdapterCommunication.h b/src/lib/AdapterCommunication.h index c9a8e8c..0d4ac9b 100644 --- a/src/lib/AdapterCommunication.h +++ b/src/lib/AdapterCommunication.h @@ -148,7 +148,6 @@ namespace CEC CecBuffer m_inBuffer; CecBuffer m_outBuffer; CMutex m_bufferMutex; - CMutex m_commMutex; CCondition m_rcvCondition; }; };