From: Lars Op den Kamp Date: Sat, 3 Dec 2011 21:37:15 +0000 (+0100) Subject: cec: send ping and bootloader commands via the output queue X-Git-Tag: upstream/2.2.0~1^2~44^2~61 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=802b7a0f90e3668f7c4eac90f8692bc9b39a4833;hp=1113cb7d55328a6c15846955626187615a9ad02e;p=deb_libcec.git cec: send ping and bootloader commands via the output queue --- diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index e6afcf4..314bfe5 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -458,7 +458,9 @@ bool CAdapterCommunication::StartBootloader(void) output->push_escaped(MSGCODE_START_BOOTLOADER); output->push_back(MSGEND); - SendMessageToAdapter(output); + CLockObject lock(&output->mutex); + if (Write(output)) + output->condition.Wait(&output->mutex); bReturn = output->state == ADAPTER_MESSAGE_STATE_SENT; delete output; @@ -478,7 +480,9 @@ bool CAdapterCommunication::PingAdapter(void) output->push_escaped(MSGCODE_PING); output->push_back(MSGEND); - SendMessageToAdapter(output); + CLockObject lock(&output->mutex); + if (Write(output)) + output->condition.Wait(&output->mutex); bReturn = output->state == ADAPTER_MESSAGE_STATE_SENT; delete output;