mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 16:27:01 -05:00
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:
parent
b2b67cfecc
commit
b7badd980f
@ -65,6 +65,7 @@ UdpBitDht::UdpBitDht(UdpPublisher *pub, bdNodeId *id, std::string appVersion, st
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* setup nodeManager */
|
/* setup nodeManager */
|
||||||
|
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
|
||||||
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, fns);
|
mBitDhtManager = new bdNodeManager(id, usedVersion, bootstrapfile, fns);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -208,7 +209,10 @@ void UdpBitDht::run()
|
|||||||
usleep(TICK_PAUSE_USEC);
|
usleep(TICK_PAUSE_USEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
|
||||||
mBitDhtManager->iteration();
|
mBitDhtManager->iteration();
|
||||||
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user