fix(timer_module): Sleep at beginning since already warmed up
This commit is contained in:
parent
6dd72aa6f7
commit
07c0fbdcb3
@ -21,16 +21,17 @@ namespace modules {
|
|||||||
void runner() {
|
void runner() {
|
||||||
try {
|
try {
|
||||||
while (this->running()) {
|
while (this->running()) {
|
||||||
|
this->sleep(m_interval);
|
||||||
|
|
||||||
|
if (!this->running()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_lock<std::mutex> guard(this->m_updatelock);
|
std::unique_lock<std::mutex> guard(this->m_updatelock);
|
||||||
|
|
||||||
if (CAST_MOD(Impl)->update()) {
|
if (CAST_MOD(Impl)->update()) {
|
||||||
this->broadcast();
|
this->broadcast();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->running()) {
|
|
||||||
guard.unlock();
|
|
||||||
this->sleep(m_interval);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (const exception& err) {
|
} catch (const exception& err) {
|
||||||
this->halt(err.what());
|
this->halt(err.what());
|
||||||
|
Loading…
Reference in New Issue
Block a user