diff --git a/src/protocol.cpp b/src/protocol.cpp index d47ceb4c..1b81d9d5 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -90,8 +90,13 @@ void CProtocol::EnqueueMessage ( CVector& vecMessage, const int iCnt, const int iID ) { - // check if list is empty so that we have to initiate a send process - const bool bListWasEmpty = SendMessQueue.empty(); + bool bListWasEmpty; + + Mutex.lock(); + { + // check if list is empty so that we have to initiate a send process + bListWasEmpty = SendMessQueue.empty(); + } // create send message object for the queue CSendMessage SendMessageObj ( vecMessage, iCnt, iID );