提交 dd6c69a2 authored 作者: blu's avatar blu

evdameon, evcloudsvc: subsystem monitor thread and defered uploading

上级 23640138
...@@ -379,7 +379,12 @@ private: ...@@ -379,7 +379,12 @@ private:
spdlog::info("evdaemon {} failed to create subsystem {}", devSn, k); spdlog::info("evdaemon {} failed to create subsystem {}", devSn, k);
} }
} }
this->bColdStart = false; this->bColdStart = false;
{
lock_guard<mutex> lock(this->mutSubMonitor);
this->cvSubMonitor.notify_all();
}
} }
else { else {
// calc diff // calc diff
...@@ -1076,8 +1081,11 @@ public: ...@@ -1076,8 +1081,11 @@ public:
while(true){ while(true){
{ {
unique_lock<mutex> lk(this->mutSubMonitor); unique_lock<mutex> lk(this->mutSubMonitor);
this->cvSubMonitor.wait_for(lk, 5s, [this] {return !this->bColdStart;}); this->cvSubMonitor.wait(lk, [this] {return !this->bColdStart;});
}
/// anti frequent restart
this_thread::sleep_for(10s);
vector<string> tmp; vector<string> tmp;
json unkown; json unkown;
vector<string> terms; vector<string> terms;
...@@ -1145,7 +1153,6 @@ public: ...@@ -1145,7 +1153,6 @@ public:
} }
} }
} }
}
}); });
this->thIdMain = this_thread::get_id(); this->thIdMain = this_thread::get_id();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论