mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed deadlock between p3connmgr::mtx and libbitdht::mtx
* shifted dht stats call outside of p3connmgr's mtx. NB: As Dht callback functions hold DHT lock, then lock p3ConnectMgr... we cannot have any opposite locks (p3connmgr, then DHT) or we have potential for a deadlock. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3861 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6589b49025
commit
d9847e2622
@ -3912,11 +3912,18 @@ bool p3ConnectMgr::getDHTEnabled()
|
||||
|
||||
void p3ConnectMgr::getNetStatus(pqiNetStatus &status)
|
||||
{
|
||||
/* cannot lock local stack, then call DHT... as this can cause lock up */
|
||||
/* must extract data... then update mNetFlags */
|
||||
|
||||
bool dhtOk = netAssistConnectActive();
|
||||
uint32_t netsize, rsnetsize;
|
||||
netAssistConnectStats(netsize, rsnetsize);
|
||||
|
||||
RsStackMutex stack(connMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* quick update of the stuff that can change! */
|
||||
mNetFlags.mDhtOk = netAssistConnectActive();
|
||||
netAssistConnectStats(mNetFlags.mDhtNetworkSize, mNetFlags.mDhtRsNetworkSize);
|
||||
mNetFlags.mDhtOk = dhtOk;
|
||||
netAssistConnectStats(netsize, rsnetsize);
|
||||
|
||||
status = mNetFlags;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user