CCECAdapterMessagePtr msg;
if (m_outBuffer.Pop(msg))
{
+ CLockObject lock(&msg->mutex);
if (m_port->Write(msg) != (int32_t) msg.get()->size())
{
CStdString strError;
m_controller->AddLog(CEC_LOG_DEBUG, "command sent");
CCondition::Sleep((uint32_t) msg.get()->size() * (uint32_t)24 /*data*/ + (uint32_t)5 /*start bit (4.5 ms)*/);
}
+ msg->condition.Signal();
}
}
void push_escaped(int16_t byte);
cec_datapacket packet;
+ CMutex mutex;
+ CCondition condition;
private:
CCECAdapterMessage &operator =(const CCECAdapterMessage &msg);
CCECAdapterMessagePtr output(new CCECAdapterMessage(data));
CLockObject lock(&m_mutex);
- if (!m_communication || !m_communication->Write(output))
- return bReturn;
+ {
+ CLockObject msgLock(&output->mutex);
+ if (!m_communication || !m_communication->Write(output))
+ return bReturn;
+ else
+ output->condition.Wait(&output->mutex);
+ }
if (bWaitForAck)
{