smartools: add destructor to call ThreadLoop::join()

Change-Id: I31c5103f78fa2516eff930ed874856589206b9c7
This commit is contained in:
philippegorley
2017-06-27 17:53:31 -04:00
parent 3ad05a0762
commit b5a50bb863
2 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,11 @@ Smartools::Smartools()
: loop_([this] { return true; }, [this] { process(); }, [] {})
{}
Smartools::~Smartools()
{
loop_.join();
}
void
Smartools::sendInfo()
{

View File

@ -40,6 +40,7 @@ class Smartools
private:
Smartools();
~Smartools();
void process();
std::map<std::string, std::string> information_;
std::mutex mutexInfo_; // Protect information_ from multithreading