Cleanup RsThread and related classes

Removed antipattern abstraction RsSingleJobThread
Rename runloop() method to run() in RsThread
Ported few classes ineriting from RsSingleJobThread to RsThread
RsThread use std::atomic instead of self implemented strange binary semaphores
Removed RsTickingThread::shutdown() use RsThread::askForStop() instead
Removed RsTickingThread::fullstop() use RsThread::fullstop() instead
Stop properly JSON API server in retroshare-gui
Centralize errno traslation to literal in util/rserrno.*
This commit is contained in:
Gioacchino Mazzurco 2019-10-31 18:23:38 +01:00
parent 358aa1e0ab
commit df87fe53b1
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
43 changed files with 490 additions and 587 deletions

View file

@ -87,7 +87,7 @@ static std::string friendlyUnit(uint64_t val)
return std::string(buf) + " TB";
}
void HashStorage::data_tick()
void HashStorage::threadTick()
{
FileHashJob job;
RsFileHash hash;
@ -318,14 +318,15 @@ void HashStorage::startHashThread()
void HashStorage::stopHashThread()
{
if (mRunning)
{
std::cerr << "Stopping hashing thread." << std::endl;
shutdown();
if(mRunning)
{
RsInfo() << __PRETTY_FUNCTION__ << "Stopping hashing thread."
<< std::endl;
RsThread::askForStop();
mRunning = false ;
mTotalSizeToHash = 0;
mTotalFilesToHash = 0;
std::cerr << "done." << std::endl;
}
}