bug fix -> deadlock
This commit is contained in:
parent
fb363895ab
commit
1e6f9f0dd9
1 changed files with 10 additions and 8 deletions
|
@ -164,11 +164,11 @@ void CProtocol::EnqueueMessage ( CVector<uint8_t>& vecMessage,
|
||||||
|
|
||||||
void CProtocol::SendMessage()
|
void CProtocol::SendMessage()
|
||||||
{
|
{
|
||||||
QMutexLocker locker ( &Mutex );
|
|
||||||
|
|
||||||
CVector<uint8_t> vecMessage;
|
CVector<uint8_t> vecMessage;
|
||||||
bool bSendMess = false;
|
bool bSendMess = false;
|
||||||
|
|
||||||
|
Mutex.lock();
|
||||||
|
{
|
||||||
// we have to check that list is not empty, since in another thread the
|
// we have to check that list is not empty, since in another thread the
|
||||||
// last element of the list might have been erased
|
// last element of the list might have been erased
|
||||||
if ( !SendMessQueue.empty() )
|
if ( !SendMessQueue.empty() )
|
||||||
|
@ -178,6 +178,8 @@ void CProtocol::SendMessage()
|
||||||
|
|
||||||
bSendMess = true;
|
bSendMess = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Mutex.unlock();
|
||||||
|
|
||||||
if ( bSendMess )
|
if ( bSendMess )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue