mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-29 09:18:45 -04:00
fixed a few bugs in internal directory storage structure
This commit is contained in:
parent
2668b6da1c
commit
ca8f95c7f7
5 changed files with 59 additions and 24 deletions
|
@ -12,7 +12,9 @@ static const uint32_t MAX_INACTIVITY_SLEEP_TIME = 2*1000*1000;
|
|||
HashStorage::HashStorage(const std::string& save_file_name)
|
||||
: mFilePath(save_file_name), mHashMtx("Hash Storage mutex")
|
||||
{
|
||||
mInactivitySleepTime = DEFAULT_INACTIVITY_SLEEP_TIME;
|
||||
mRunning = false ;
|
||||
|
||||
load() ;
|
||||
}
|
||||
|
||||
|
@ -63,7 +65,11 @@ void HashStorage::data_tick()
|
|||
}
|
||||
mInactivitySleepTime = DEFAULT_INACTIVITY_SLEEP_TIME;
|
||||
|
||||
job = mFilesToHash.begin()->second ;
|
||||
{
|
||||
RS_STACK_MUTEX(mHashMtx) ;
|
||||
job = mFilesToHash.begin()->second ;
|
||||
mFilesToHash.erase(mFilesToHash.begin()) ;
|
||||
}
|
||||
|
||||
std::cerr << "Hashing file " << job.full_path << "..." ; std::cerr.flush();
|
||||
|
||||
|
@ -77,8 +83,6 @@ void HashStorage::data_tick()
|
|||
else
|
||||
std::cerr << "done."<< std::endl;
|
||||
|
||||
mFilesToHash.erase(mFilesToHash.begin()) ;
|
||||
|
||||
// store the result
|
||||
|
||||
HashStorageInfo& info(mFiles[job.full_path]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue