From 78f1ea769060cd631c210fc01020bb921afe3607 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Aug 2011 10:15:20 +0100 Subject: OSYSTEM: extended installTimerProc() with timer ID parameter --- backends/timer/default/default-timer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backends/timer/default/default-timer.h') diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h index 66d2e3b091..33dd46cc57 100644 --- a/backends/timer/default/default-timer.h +++ b/backends/timer/default/default-timer.h @@ -22,6 +22,7 @@ #ifndef BACKENDS_TIMER_DEFAULT_H #define BACKENDS_TIMER_DEFAULT_H +#include "common/str.h" #include "common/timer.h" #include "common/mutex.h" @@ -36,7 +37,7 @@ private: public: DefaultTimerManager(); virtual ~DefaultTimerManager(); - virtual bool installTimerProc(TimerProc proc, int32 interval, void *refCon); + virtual bool installTimerProc(TimerProc proc, int32 interval, void *refCon, const Common::String &id); virtual void removeTimerProc(TimerProc proc); /** -- cgit v1.2.3 From 4c7958450f628937270f259cc480c1191ea2fb2f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 5 Aug 2011 17:56:04 +0100 Subject: TIMER: Implemented checks for duplicated timers --- backends/timer/default/default-timer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/timer/default/default-timer.h') diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h index 33dd46cc57..e5a9dada79 100644 --- a/backends/timer/default/default-timer.h +++ b/backends/timer/default/default-timer.h @@ -23,6 +23,7 @@ #define BACKENDS_TIMER_DEFAULT_H #include "common/str.h" +#include "common/hash-str.h" #include "common/timer.h" #include "common/mutex.h" @@ -30,9 +31,12 @@ struct TimerSlot; class DefaultTimerManager : public Common::TimerManager { private: + typedef Common::HashMap<Common::String, TimerProc, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> TimerSlotMap; + Common::Mutex _mutex; void *_timerHandler; TimerSlot *_head; + TimerSlotMap _callbacks; public: DefaultTimerManager(); -- cgit v1.2.3