fixed bug in mutexes causing a deadlock in gxs integrity check

This commit is contained in:
csoler 2020-12-08 23:45:31 +01:00
parent 8f5656433a
commit ed5f8618b6

View file

@ -299,12 +299,13 @@ void RsGenExchange::tick()
if(mIntegrityCheck->isDone()) if(mIntegrityCheck->isDone())
{ {
RS_STACK_MUTEX(mGenMtx) ;
std::vector<RsGxsGroupId> grpIds; std::vector<RsGxsGroupId> grpIds;
GxsMsgReq msgIds; GxsMsgReq msgIds;
mIntegrityCheck->getDeletedIds(grpIds, msgIds); {
RS_STACK_MUTEX(mGenMtx) ;
mIntegrityCheck->getDeletedIds(grpIds, msgIds);
}
if(!msgIds.empty()) if(!msgIds.empty())
{ {
@ -319,9 +320,12 @@ void RsGenExchange::tick()
deleteGroup(token2,grpId); deleteGroup(token2,grpId);
} }
delete mIntegrityCheck; {
mIntegrityCheck = NULL; RS_STACK_MUTEX(mGenMtx) ;
mChecking = false; delete mIntegrityCheck;
mIntegrityCheck = NULL;
mChecking = false;
}
} }
} }
} }