mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-21 21:01:15 -05:00
added a check to avoid (possibly rare) data races
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2901 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
73343f9250
commit
37a2bfb8de
@ -478,6 +478,10 @@ bool ftDataMultiplex::handleRecvServerChunkMapRequest(const std::string& peerId,
|
|||||||
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
RsStackMutex stack(dataMtx); /******* LOCK MUTEX ******/
|
||||||
|
|
||||||
it = mServers.find(hash) ;
|
it = mServers.find(hash) ;
|
||||||
|
|
||||||
|
if(it == mServers.end()) // handleSearchRequest should have filled mServers[hash], but we have been off-mutex since,
|
||||||
|
return false ; // so it's safer to check again.
|
||||||
|
else
|
||||||
it->second->getAvailabilityMap(cmap);
|
it->second->getAvailabilityMap(cmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user