mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 09:18:45 -04:00
fixed threading issues in directory updater
This commit is contained in:
parent
067d4231ae
commit
43f4f5d2d9
3 changed files with 19 additions and 13 deletions
|
@ -19,7 +19,15 @@ void HashStorage::data_tick()
|
|||
RS_STACK_MUTEX(mHashMtx) ;
|
||||
|
||||
if(mFilesToHash.empty())
|
||||
{
|
||||
std::cerr << "Stopping hashing thread." << std::endl;
|
||||
shutdown();
|
||||
mRunning = false ;
|
||||
std::cerr << "done." << std::endl;
|
||||
|
||||
usleep(2*1000*1000); // when no files to hash, just wait for 2 secs. This avoids a dramatic loop.
|
||||
return ;
|
||||
}
|
||||
|
||||
job = mFilesToHash.begin()->second ;
|
||||
|
||||
|
@ -33,14 +41,6 @@ void HashStorage::data_tick()
|
|||
|
||||
mFilesToHash.erase(mFilesToHash.begin()) ;
|
||||
|
||||
if(mFilesToHash.empty())
|
||||
{
|
||||
std::cerr << "Stopping hashing thread." << std::endl;
|
||||
shutdown();
|
||||
mRunning = false ;
|
||||
std::cerr << "done." << std::endl;
|
||||
}
|
||||
|
||||
// store the result
|
||||
|
||||
HashStorageInfo& info(mFiles[job.full_path]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue