mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Added a name to the RsMutex class.
You can enable the debugging of the waiting time for a lock of RsMutex in rsthreads.h with #define RSMUTEX_DEBUG 300 That means all locks waiting longer than 300ms are logged into the stderr. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4392 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a94568ac33
commit
de87a89437
42 changed files with 103 additions and 64 deletions
|
@ -100,6 +100,8 @@ ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, std::string c
|
|||
last_clean_time(0),
|
||||
mDataplex(dm),
|
||||
mTurtle(NULL),
|
||||
ctrlMutex("ftController"),
|
||||
doneMutex("ftController"),
|
||||
mFtActive(false),
|
||||
mDefaultChunkStrategy(FileChunksInfo::CHUNK_STRATEGY_RANDOM)
|
||||
{
|
||||
|
|
|
@ -64,7 +64,7 @@ ftRequest::ftRequest(uint32_t type, std::string peerId, std::string hash, uint64
|
|||
}
|
||||
|
||||
ftDataMultiplex::ftDataMultiplex(std::string ownId, ftDataSend *server, ftSearch *search)
|
||||
:RsQueueThread(DMULTIPLEX_MIN, DMULTIPLEX_MAX, DMULTIPLEX_RELAX),
|
||||
:RsQueueThread(DMULTIPLEX_MIN, DMULTIPLEX_MAX, DMULTIPLEX_RELAX), dataMtx("ftDataMultiplex"),
|
||||
mDataSend(server), mSearch(search), mOwnId(ownId)
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
*****/
|
||||
|
||||
ftExtraList::ftExtraList()
|
||||
:p3Config(CONFIG_TYPE_FT_EXTRA_LIST)
|
||||
:p3Config(CONFIG_TYPE_FT_EXTRA_LIST), extMutex("p3Config")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
static const time_t UPLOAD_CHUNK_MAPS_TIME = 20 ; // time to ask for a new chunkmap from uploaders in seconds.
|
||||
|
||||
ftFileProvider::ftFileProvider(const std::string& path, uint64_t size, const std::string& hash)
|
||||
: mSize(size), hash(hash), file_name(path), fd(NULL)
|
||||
: mSize(size), hash(hash), file_name(path), fd(NULL), ftcMutex("ftFileProvider")
|
||||
{
|
||||
RsStackMutex stack(ftcMutex); /********** STACK LOCKED MTX ******/
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ ftServer::ftServer(p3ConnectMgr *connMgr)
|
|||
mCacheStrapper(NULL),
|
||||
mFiStore(NULL), mFiMon(NULL),
|
||||
mFtController(NULL), mFtExtra(NULL),
|
||||
mFtDataplex(NULL), mFtSearch(NULL)
|
||||
mFtDataplex(NULL), mFtSearch(NULL), srvMutex("ftServer")
|
||||
{
|
||||
mCacheStrapper = new ftCacheStrapper(connMgr);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ const uint32_t FT_TM_CRC_MAP_STATE_HAVE = 2 ;
|
|||
#define FT_TM_FLAG_CHUNK_CRC 4
|
||||
|
||||
ftTransferModule::ftTransferModule(ftFileCreator *fc, ftDataMultiplex *dm, ftController *c)
|
||||
:mFileCreator(fc), mMultiplexor(dm), mFtController(c), mFlag(FT_TM_FLAG_DOWNLOADING)
|
||||
:mFileCreator(fc), mMultiplexor(dm), mFtController(c), tfMtx("ftTransferModule"), mFlag(FT_TM_FLAG_DOWNLOADING)
|
||||
{
|
||||
RsStackMutex stack(tfMtx); /******* STACK LOCKED ******/
|
||||
|
||||
|
@ -518,7 +518,7 @@ class HashThread: public RsThread
|
|||
{
|
||||
public:
|
||||
HashThread(ftFileCreator *m)
|
||||
: _m(m),_finished(false),_hash("") {}
|
||||
: _hashThreadMtx("HashThread"), _m(m),_finished(false),_hash("") {}
|
||||
|
||||
virtual void run()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue