Skip to content
Snippets Groups Projects
Commit b5a50bb8 authored by Philippe Gorley's avatar Philippe Gorley
Browse files

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

Change-Id: I31c5103f78fa2516eff930ed874856589206b9c7
parent 3ad05a07
Branches
Tags
No related merge requests found
...@@ -39,6 +39,11 @@ Smartools::Smartools() ...@@ -39,6 +39,11 @@ Smartools::Smartools()
: loop_([this] { return true; }, [this] { process(); }, [] {}) : loop_([this] { return true; }, [this] { process(); }, [] {})
{} {}
Smartools::~Smartools()
{
loop_.join();
}
void void
Smartools::sendInfo() Smartools::sendInfo()
{ {
......
...@@ -40,6 +40,7 @@ class Smartools ...@@ -40,6 +40,7 @@ class Smartools
private: private:
Smartools(); Smartools();
~Smartools();
void process(); void process();
std::map<std::string, std::string> information_; std::map<std::string, std::string> information_;
std::mutex mutexInfo_; // Protect information_ from multithreading std::mutex mutexInfo_; // Protect information_ from multithreading
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment