X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FAdapterCommunication.cpp;h=314bfe50b1d1b6049fc974cc124d6dba7edc5c2a;hb=802b7a0f90e3668f7c4eac90f8692bc9b39a4833;hp=e6afcf463bae80fd0cacbf2f964090fa418caaed;hpb=1113cb7d55328a6c15846955626187615a9ad02e;p=deb_libcec.git 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;