in prod/native/libcommon/code/PeriodicTaskExecutor.h [58:80]
void work() {
if (workerInit_) {
workerInit_();
}
std::unique_lock<std::mutex> lock(mutex_);
while(working_) {
pauseCondition_.wait(lock, [this]() -> bool {
return resumed_ || !working_;
});
if (!working_) {
break;
}
lock.unlock();
std::this_thread::sleep_for(sleepInterval_);
for (auto const &task : periodicTasks_) {
task(std::chrono::time_point_cast<std::chrono::milliseconds>(clock_t::now()));
}
lock.lock();
}
}