16 #include <condition_variable> 28 active_ = (interval > std::chrono::seconds::zero());
37 std::unique_lock<std::mutex> lock(this->
mutex_);
38 if (this->
cv_.wait_for(lock, interval, [
this] { return !this->active_; }))
56 std::lock_guard<std::mutex> lock(
mutex_);
68 std::condition_variable
cv_;
periodic_worker(const std::function< void()> &callback_fun, std::chrono::seconds interval)
second seconds
Alias for common language habits.
periodic_worker & operator=(const periodic_worker &)=delete
std::condition_variable cv_
std::thread worker_thread_
void function(int client, int *resource, int parblock, int *test, int p)