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;
{
RS_STACK_MUTEX(mGenMtx) ;
mIntegrityCheck->getDeletedIds(grpIds, msgIds); mIntegrityCheck->getDeletedIds(grpIds, msgIds);
}
if(!msgIds.empty()) if(!msgIds.empty())
{ {
@ -319,11 +320,14 @@ void RsGenExchange::tick()
deleteGroup(token2,grpId); deleteGroup(token2,grpId);
} }
{
RS_STACK_MUTEX(mGenMtx) ;
delete mIntegrityCheck; delete mIntegrityCheck;
mIntegrityCheck = NULL; mIntegrityCheck = NULL;
mChecking = false; mChecking = false;
} }
} }
}
} }
bool RsGenExchange::messagePublicationTest(const RsGxsMsgMetaData& meta) bool RsGenExchange::messagePublicationTest(const RsGxsMsgMetaData& meta)