From 8f0c739f87d2de8808f49da6f0abc9fcb6e220fc Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 3 Jul 2003 11:18:07 +0000 Subject: Timer now uses a mutex, which should make it thread safe (it wasn't before, particuarly bad if timers are implemented via threads), plus this should help in fixing race conditions in classes using class Timer svn-id: r8722 --- common/timer.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'common/timer.h') diff --git a/common/timer.h b/common/timer.h index 0ed416679d..78877963f4 100644 --- a/common/timer.h +++ b/common/timer.h @@ -36,8 +36,7 @@ class Timer { private: Engine *_engine; - bool _initialized; - bool _timerRunning; + void *_mutex; void *_timerHandler; int32 _thisTime; int32 _lastTime; @@ -49,11 +48,9 @@ private: } _timerSlots[MAX_TIMERS]; public: - Timer(Engine *engine); - ~Timer(); + Timer(Engine *engine); + ~Timer(); - bool init(); - void release(); bool installProcedure(TimerProc procedure, int32 interval); void releaseProcedure(TimerProc procedure); -- cgit v1.2.3