23 #ifndef __ccxx_ScopedLock_hxx 24 #define __ccxx_ScopedLock_hxx 72 inline bool testOnce()
73 {
bool f = _once; _once =
false;
return(f); }
94 #if (defined CCXX_OS_WINDOWS) && (defined _MSC_VER) && (_MSC_VER < 1400) 96 #define synchronized(LOCK) \ 97 for(ccxx::ScopedLock LOCK ## _locker(LOCK); \ 98 LOCK ## _locker.testOnce();) 102 #define synchronized(LOCK) \ 103 for(ccxx::ScopedLock \ 104 CCXX_UNIQUE_VARNAME(LOCK, __LINE__, locker)(LOCK); \ 105 CCXX_UNIQUE_VARNAME(LOCK, __LINE__, locker).testOnce();) 109 #endif // __ccxx_ScopedLock_hxx virtual void unlock()=0
Unlock operation.
A convenience object for lexical scope based synchronization.
Definition: ScopedLock.h++:50
An abstract base class for synchronization primitives.
Definition: Lock.h++:35
ScopedLock(Lock &lock)
Construct a new Scopedock for the given Lock.
Definition: ScopedLock.h++:58
~ScopedLock()
Destructor.
Definition: ScopedLock.h++:66
virtual void lock()=0
Lock operation.
Definition: AllocationMap.c++:25