feat support default Timer::Ptr = nullptr
All checks were successful
linux-arm-gcc / linux-gcc-armhf (push) Successful in 1m59s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Successful in 2m3s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 2m18s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 2m30s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 2m40s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 11m18s

This commit is contained in:
tqcq 2024-05-01 08:09:06 +00:00
parent 00e6e92041
commit 0990783878

View File

@ -17,16 +17,17 @@ typedef uint32_t TimerGeneration;
class Timer;
struct TimerThreadDeleter {
TimerThreadDeleter() = default;
TimerThreadDeleter(TaskQueueBase *owner);
inline void operator()(Timer *timer);
private:
TaskQueueBase *owner_;
TaskQueueBase *owner_ = nullptr;
};
class Timer {
public:
using Ptr= std::unique_ptr<Timer, TimerThreadDeleter>;
using Ptr = std::unique_ptr<Timer, TimerThreadDeleter>;
using OnExpired = std::function<sled::optional<DurationMs>()>;
Timer(const Timer &) = delete;