mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
generally prevent threads to start twice, and fixed bug causing DirWatcher to be run twice
This commit is contained in:
parent
eb95c6895a
commit
461975f115
@ -54,10 +54,10 @@ void LocalDirectoryUpdater::setEnabled(bool b)
|
||||
if(mIsEnabled == b)
|
||||
return ;
|
||||
|
||||
if(b)
|
||||
start("fs dir updater") ;
|
||||
else
|
||||
if(!b)
|
||||
shutdown();
|
||||
else if(!isRunning())
|
||||
start("fs dir updater") ;
|
||||
|
||||
mIsEnabled = b ;
|
||||
}
|
||||
|
@ -157,6 +157,11 @@ void RsTickingThread::fullstop()
|
||||
|
||||
void RsThread::start(const std::string &threadName)
|
||||
{
|
||||
if(isRunning())
|
||||
{
|
||||
std::cerr << "(EE) RsThread \"" << threadName << "\" is already running. Will not start twice!" << std::endl;
|
||||
return ;
|
||||
}
|
||||
pthread_t tid;
|
||||
void *data = (void *)this ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user