X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftime%2Ftimer.h;h=33257319eba3466d89f28c650efcd26dde0a996d;hb=85ef592fb1eab68283b12607701e4fb9b9014630;hp=21aeb2b4b5b02ea0b41932f4a3311028f35c7e55;hpb=1a563cfd722a5571428562259790b4948980dd4f;p=libs%2Fcore.git diff --git a/source/time/timer.h b/source/time/timer.h index 21aeb2b..3325731 100644 --- a/source/time/timer.h +++ b/source/time/timer.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "timedelta.h" #include "timestamp.h" @@ -18,7 +19,7 @@ of the returned slot. This class is thread-safe, to allow running timers in a separate thread. */ -class Timer +class Timer: private NonCopyable { public: class Slot @@ -40,7 +41,7 @@ public: private: struct SlotProxy { - Slot *slot; + Slot *slot = nullptr; SlotProxy(Slot *); bool operator<(const SlotProxy &) const; @@ -49,7 +50,7 @@ private: std::vector slots; Semaphore sem; Mutex mutex; - bool blocking; + bool blocking = false; public: Timer(); @@ -66,9 +67,6 @@ public: /** Cancels a previously added timer. */ void cancel(Slot &); - /** Deprecated. Use one of the other overloads. */ - void tick(bool block); - /** Waits until a timer expires, then executes it. If no timers have been set, blocks until one is added from another thread. */ void tick();