Merge pull request #399 from sehraf/pr-thread-names-2

add thread names for the remaning threads
This commit is contained in:
Cyril Soler 2016-06-01 11:35:54 -04:00
commit 65585658a5
11 changed files with 32 additions and 31 deletions

View file

@ -30,7 +30,7 @@ RsControlModule::RsControlModule(int argc, char **argv, StateTokenServer* sts, A
this->argv = argv; this->argv = argv;
// start worker thread // start worker thread
if(full_control) if(full_control)
start("RS ctrl module"); start("resapi ctrl mod");
else else
mRunState = RUNNING_OK_NO_FULL_CONTROL; mRunState = RUNNING_OK_NO_FULL_CONTROL;

View file

@ -188,18 +188,18 @@ void ftServer::StartupThreads()
/* self contained threads */ /* self contained threads */
/* startup ExtraList Thread */ /* startup ExtraList Thread */
mFtExtra->start("RS ft extra lst"); mFtExtra->start("ft extra lst");
/* startup Monitor Thread */ /* startup Monitor Thread */
/* startup the FileMonitor (after cache load) */ /* startup the FileMonitor (after cache load) */
/* start it up */ /* start it up */
mFiMon->start("RS ft monitor"); mFiMon->start("ft monitor");
/* Controller thread */ /* Controller thread */
mFtController->start("RS ft ctrl"); mFtController->start("ft ctrl");
/* Dataplex */ /* Dataplex */
mFtDataplex->start("RS ft dataplex"); mFtDataplex->start("ft dataplex");
} }
void ftServer::StopThreads() void ftServer::StopThreads()

View file

@ -592,7 +592,7 @@ bool ftTransferModule::checkFile()
// Note: using new is really important to avoid copy and write errors in the thread. // Note: using new is really important to avoid copy and write errors in the thread.
// //
_hash_thread = new HashThread(mFileCreator) ; _hash_thread = new HashThread(mFileCreator) ;
_hash_thread->start() ; _hash_thread->start("ft hash") ;
#ifdef FT_DEBUG #ifdef FT_DEBUG
std::cerr << "ftTransferModule::checkFile(): launched hashing thread for file " << mHash << std::endl ; std::cerr << "ftTransferModule::checkFile(): launched hashing thread for file " << mHash << std::endl ;
#endif #endif

View file

@ -265,7 +265,7 @@ void RsGenExchange::tick()
else else
{ {
mIntegrityCheck = new RsGxsIntegrityCheck(mDataStore,mGixs); mIntegrityCheck = new RsGxsIntegrityCheck(mDataStore,mGixs);
mIntegrityCheck->start(); mIntegrityCheck->start("gxs integrity");
mChecking = true; mChecking = true;
} }
} }

View file

@ -130,7 +130,7 @@ AuthGPG::AuthGPG(const std::string& path_to_public_keyring,const std::string& pa
{ {
_force_sync_database = false ; _force_sync_database = false ;
mCount = 0; mCount = 0;
start(); start("AuthGPG");
} }
/* This function is called when retroshare is first started /* This function is called when retroshare is first started

View file

@ -347,7 +347,8 @@ int pqiperson::handleNotifyEvent_locked(NetInterface *ni, int newState,
activepqi = pqi; activepqi = pqi;
inConnectAttempt = false; inConnectAttempt = false;
activepqi->start(); // STARTUP THREAD. // STARTUP THREAD
activepqi->start("pqi " + PeerId().toStdString().substr(0, 11));
// reset all other children (clear up long UDP attempt) // reset all other children (clear up long UDP attempt)
for(it = kids.begin(); it != kids.end(); ++it) for(it = kids.begin(); it != kids.end(); ++it)

View file

@ -71,9 +71,9 @@ void RsServer::ConfigFinalSave()
mConfigMgr->completeConfiguration(); mConfigMgr->completeConfiguration();
} }
void RsServer::startServiceThread(RsTickingThread *t) void RsServer::startServiceThread(RsTickingThread *t, const std::string &threadName)
{ {
t->start() ; t->start(threadName) ;
mRegisteredServiceThreads.push_back(t) ; mRegisteredServiceThreads.push_back(t) ;
} }

View file

@ -121,7 +121,7 @@ class RsServer: public RsControl, public RsTickingThread
/* Config */ /* Config */
virtual void ConfigFinalSave( ); virtual void ConfigFinalSave( );
virtual void startServiceThread(RsTickingThread *t) ; virtual void startServiceThread(RsTickingThread *t, const std::string &threadName) ;
/************* Rs shut down function: in upnp 'port lease time' bug *****************/ /************* Rs shut down function: in upnp 'port lease time' bug *****************/

View file

@ -1768,27 +1768,27 @@ int RsServer::StartupRetroShare()
//rsWire = mWire; //rsWire = mWire;
/*** start up GXS core runner ***/ /*** start up GXS core runner ***/
startServiceThread(mGxsIdService); startServiceThread(mGxsIdService, "gxs id");
startServiceThread(mGxsCircles); startServiceThread(mGxsCircles, "gxs circle");
startServiceThread(mPosted); startServiceThread(mPosted, "gxs posted");
#if RS_USE_WIKI #if RS_USE_WIKI
startServiceThread(mWiki); startServiceThread(mWiki, "gxs wiki");
#endif #endif
startServiceThread(mGxsForums); startServiceThread(mGxsForums, "gxs forums");
startServiceThread(mGxsChannels); startServiceThread(mGxsChannels, "gxs channels");
//createThread(*mPhoto); //createThread(*mPhoto);
//createThread(*mWire); //createThread(*mWire);
// cores ready start up GXS net servers // cores ready start up GXS net servers
startServiceThread(gxsid_ns); startServiceThread(gxsid_ns, "gxs id ns");
startServiceThread(gxscircles_ns); startServiceThread(gxscircles_ns, "gxs circle ns");
startServiceThread(posted_ns); startServiceThread(posted_ns, "gxs posted ns");
#if RS_USE_WIKI #if RS_USE_WIKI
startServiceThread(wiki_ns); startServiceThread(wiki_ns, "gxs wiki ns");
#endif #endif
startServiceThread(gxsforums_ns); startServiceThread(gxsforums_ns, "gxs forums ns");
startServiceThread(gxschannels_ns); startServiceThread(gxschannels_ns, "gxs channels ns");
//createThread(*photo_ns); //createThread(*photo_ns);
//createThread(*wire_ns); //createThread(*wire_ns);
@ -1834,7 +1834,7 @@ int RsServer::StartupRetroShare()
} }
/* Startup this thread! */ /* Startup this thread! */
start() ; start("rs main") ;
return 1; return 1;
} }

View file

@ -65,12 +65,12 @@ p3FeedReader::p3FeedReader(RsPluginHandler* pgHandler, RsGxsForums *forums)
/* start download thread */ /* start download thread */
p3FeedReaderThread *frt = new p3FeedReaderThread(this, p3FeedReaderThread::DOWNLOAD, ""); p3FeedReaderThread *frt = new p3FeedReaderThread(this, p3FeedReaderThread::DOWNLOAD, "");
mThreads.push_back(frt); mThreads.push_back(frt);
frt->start(); frt->start("fr download");
/* start process thread */ /* start process thread */
frt = new p3FeedReaderThread(this, p3FeedReaderThread::PROCESS, ""); frt = new p3FeedReaderThread(this, p3FeedReaderThread::PROCESS, "");
mThreads.push_back(frt); mThreads.push_back(frt);
frt->start(); frt->start("fr process");
} }
/***************************************************************************/ /***************************************************************************/
@ -698,11 +698,11 @@ bool p3FeedReader::addPreviewFeed(const FeedInfo &feedInfo, std::string &feedId)
/* start download thread for preview */ /* start download thread for preview */
mPreviewDownloadThread = new p3FeedReaderThread(this, p3FeedReaderThread::DOWNLOAD, feedId); mPreviewDownloadThread = new p3FeedReaderThread(this, p3FeedReaderThread::DOWNLOAD, feedId);
mPreviewDownloadThread->start(); mPreviewDownloadThread->start("fr preview dl");
/* start process thread for preview */ /* start process thread for preview */
mPreviewProcessThread = new p3FeedReaderThread(this, p3FeedReaderThread::PROCESS, feedId); mPreviewProcessThread = new p3FeedReaderThread(this, p3FeedReaderThread::PROCESS, feedId);
mPreviewProcessThread->start(); mPreviewProcessThread->start("fr preview proc");
} }
return true; return true;

View file

@ -88,7 +88,7 @@ namespace resource_api {
TerminalApiClient::TerminalApiClient(ApiServer *api): TerminalApiClient::TerminalApiClient(ApiServer *api):
mApiServer(api) mApiServer(api)
{ {
start(); start("resapi terminal");
} }
TerminalApiClient::~TerminalApiClient() TerminalApiClient::~TerminalApiClient()