mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
Added some missing locks in p3GroupDistrib.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5039 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
633b66b1dd
commit
e90b8c86d4
@ -429,10 +429,10 @@ void p3GroupDistrib::loadFileGroups(const std::string &filename, const std::stri
|
|||||||
|
|
||||||
delete store;
|
delete store;
|
||||||
|
|
||||||
/* clear publication of groups if local cache file found */
|
|
||||||
RsStackMutex stack(distribMtx); /******* STACK LOCKED MUTEX ***********/
|
|
||||||
if (local)
|
if (local)
|
||||||
{
|
{
|
||||||
|
/* clear publication of groups if local cache file found */
|
||||||
|
RsStackMutex stack(distribMtx); /******* STACK LOCKED MUTEX ***********/
|
||||||
mGroupsRepublish = false;
|
mGroupsRepublish = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,6 +528,7 @@ void p3GroupDistrib::loadFileMsgs(const std::string &filename, const CacheData&
|
|||||||
std::cerr << "p3GroupDistrib::loadFileMsgs() CacheSubId: " << cacheSubId << " recvd: " << ts;
|
std::cerr << "p3GroupDistrib::loadFileMsgs() CacheSubId: " << cacheSubId << " recvd: " << ts;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
RsStackMutex stack(distribMtx);
|
||||||
|
|
||||||
mLocalCacheTs[data.recvd] = cacheSubId;
|
mLocalCacheTs[data.recvd] = cacheSubId;
|
||||||
if (cacheSubId > mMaxCacheSubId)
|
if (cacheSubId > mMaxCacheSubId)
|
||||||
@ -556,12 +557,15 @@ void p3GroupDistrib::loadFileMsgs(const std::string &filename, const CacheData&
|
|||||||
|
|
||||||
bool p3GroupDistrib::processCacheOptReq(std::string grpId)
|
bool p3GroupDistrib::processCacheOptReq(std::string grpId)
|
||||||
{
|
{
|
||||||
if(mSubscribedGrp.find(grpId) != mSubscribedGrp.end())
|
{
|
||||||
return false;
|
RsStackMutex stack(distribMtx);
|
||||||
|
if(mSubscribedGrp.find(grpId) != mSubscribedGrp.end())
|
||||||
|
return false;
|
||||||
|
|
||||||
// grp already loaded
|
// grp already loaded
|
||||||
if(mCacheOptLoaded.find(grpId) != mCacheOptLoaded.end())
|
if(mCacheOptLoaded.find(grpId) != mCacheOptLoaded.end())
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
std::list<CacheData> cList;
|
std::list<CacheData> cList;
|
||||||
@ -585,6 +589,7 @@ bool p3GroupDistrib::processCacheOptReq(std::string grpId)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RsStackMutex stack(distribMtx);
|
||||||
mCacheOptLoaded.insert(grpId);
|
mCacheOptLoaded.insert(grpId);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -2355,6 +2360,7 @@ void p3GroupDistrib::receivePubKeys(){
|
|||||||
RsDistribGrpKey* key_item = dynamic_cast<RsDistribGrpKey*>(item);
|
RsDistribGrpKey* key_item = dynamic_cast<RsDistribGrpKey*>(item);
|
||||||
|
|
||||||
if(key_item != NULL){
|
if(key_item != NULL){
|
||||||
|
RsStackMutex stack(distribMtx);
|
||||||
|
|
||||||
it = mGroups.find(key_item->grpId);
|
it = mGroups.find(key_item->grpId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user