aboutsummaryrefslogtreecommitdiff
path: root/common/timer.h
diff options
context:
space:
mode:
authorMax Horn2003-07-03 11:18:07 +0000
committerMax Horn2003-07-03 11:18:07 +0000
commit8f0c739f87d2de8808f49da6f0abc9fcb6e220fc (patch)
treeac988b6e748a95b5e72a1d389c7d27abdefe1f9f /common/timer.h
parent7404d5662d3f624f519ab540b52932f7b7630d93 (diff)
downloadscummvm-rg350-8f0c739f87d2de8808f49da6f0abc9fcb6e220fc.tar.gz
scummvm-rg350-8f0c739f87d2de8808f49da6f0abc9fcb6e220fc.tar.bz2
scummvm-rg350-8f0c739f87d2de8808f49da6f0abc9fcb6e220fc.zip
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
Diffstat (limited to 'common/timer.h')
-rw-r--r--common/timer.h9
1 files changed, 3 insertions, 6 deletions
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);