diff options
author | Max Horn | 2003-07-05 15:19:11 +0000 |
---|---|---|
committer | Max Horn | 2003-07-05 15:19:11 +0000 |
commit | d098334fe651616afa8b5314bcf580ae835185b2 (patch) | |
tree | 5442e167b6a58dea66f8482a1afcae264dfbbc1a /common/util.h | |
parent | 4611b12c0a84ec528f9f020dc85bf4e9a0108c82 (diff) | |
download | scummvm-rg350-d098334fe651616afa8b5314bcf580ae835185b2.tar.gz scummvm-rg350-d098334fe651616afa8b5314bcf580ae835185b2.tar.bz2 scummvm-rg350-d098334fe651616afa8b5314bcf580ae835185b2.zip |
updated code to use type MutexRef; added class StackLock (from sdl backend, now in util.*)
svn-id: r8777
Diffstat (limited to 'common/util.h')
-rw-r--r-- | common/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/common/util.h b/common/util.h index cc9a45c0e7..8c0409e0ef 100644 --- a/common/util.h +++ b/common/util.h @@ -22,6 +22,7 @@ #define COMMON_UTIL_H #include "scummsys.h" +#include "system.h" template<typename T> inline T ABS (T x) { return (x>=0) ? x : -x; } template<typename T> inline T MIN (T a, T b) { return (a<b) ? a : b; } @@ -74,4 +75,17 @@ public: uint getRandomNumberRng(uint min, uint max); }; +/** + * Auxillary class to (un)lock a mutex on the stack. + */ +class StackLock { + OSystem::MutexRef _mutex; + void lock(); + void unlock(); +public: + StackLock(OSystem::MutexRef mutex); + ~StackLock(); +}; + + #endif |