This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
fortuna/do_task.h
surtur b7c7558e1f
All checks were successful
continuous-integration/drone/push Build is passing
DoTask: timed_mutex -> recursive_timed_mutex
2022-01-21 02:54:15 +01:00

29 lines
493 B
C++

#ifndef FORTUNA_DO_TASK_H
#define FORTUNA_DO_TASK_H
#include <chrono>
#include <functional>
#include <mutex>
#include <thread>
namespace fortuna {
class DoTask {
private:
std::recursive_timed_mutex mtx_do_sleep;
std::thread th;
public:
DoTask() noexcept = default;
~DoTask() noexcept;
auto thread_pls(const std::chrono::seconds& interval,
std::function<void()> callback) -> void;
auto die_pls() -> void;
}; // class DoTask
} // namespace fortuna
#endif // FORTUNA_DO_TASK_H