X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ftime%2Ftimer.h;h=33257319eba3466d89f28c650efcd26dde0a996d;hp=21aeb2b4b5b02ea0b41932f4a3311028f35c7e55;hb=HEAD;hpb=108f2e7de1c2427e39cdf55efbcd0ca3914e451a diff --git a/source/time/timer.h b/source/time/timer.h index 21aeb2b..7cb5c76 100644 --- a/source/time/timer.h +++ b/source/time/timer.h @@ -3,7 +3,9 @@ #include #include +#include #include +#include #include #include "timedelta.h" #include "timestamp.h" @@ -18,7 +20,7 @@ of the returned slot. This class is thread-safe, to allow running timers in a separate thread. */ -class Timer +class MSPCORE_API Timer: private NonCopyable { public: class Slot @@ -42,14 +44,13 @@ private: { Slot *slot; - SlotProxy(Slot *); bool operator<(const SlotProxy &) const; }; 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();