added mutex to correct data race between bdNodeManager::iteration() and bdnodeManager::incomingMsg()

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3840 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-11-21 14:31:35 +00:00
parent b2b67cfecc
commit b7badd980f

View File

@ -65,6 +65,7 @@ UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, st
#endif
/* setup nodeManager */
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, fns);
}
@ -208,7 +209,10 @@ void UdpBitDht::run()
usleep(TICK_PAUSE_USEC);
}
mBitDhtManager->iteration();
{
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
mBitDhtManager->iteration();
}
sleep(1);
}
}