From 21ca2c62a26ec13971766853ee5bf37d02ba60fc Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Tue, 7 Mar 2006 20:22:52 +0000 Subject: [PATCH] bug fix --- src/protocol.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index fc325f97..9052cd98 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -140,21 +140,23 @@ void CProtocol::CreateAndSendAcknMess ( const int& iID, const int& iCnt ) emit MessReadyForSending ( vecAcknMessage ); } +void CProtocol::DeleteSendMessQueue() +{ +/* + Actually, this function must be secured by a mutex, too. The problem is that + this function is called from OnSendProtMessage in client which is called + from a mutexed function of this object. In this case, we will get a dead + lock. +*/ + // delete complete "send message queue" + SendMessQueue.clear(); +} + /* The following functions are access functions from different threads. These functions have to be secured by a mutex to avoid data corruption */ -void CProtocol::DeleteSendMessQueue() -{ - Mutex.lock(); - { - // delete complete "send message queue" - SendMessQueue.clear(); - } - Mutex.unlock(); -} - void CProtocol::OnTimerSendMess() { Mutex.lock();