2 #include "g_mthread_CriticalSection.h"
5 #define G_LOCK_DEFAULT_TIMEOUT 5.0
15 #define G_LOCK_CONTEXT(aobjwithlock) (aobjwithlock).lock ( _g_method_context )
16 #define G_LOCK_CONTEXT_TIMEOUT(aobjwithlock,atimeout) (aobjwithlock).lock ( _g_method_context , atimeout )
17 #define G_UNLOCK(aobjwithlock) (aobjwithlock).unlock ( );
22 friend class TimeoutTicket;
27 bool tryLock ( ) {
return mInnerCriticalSection.tryWait(); }
28 void lock (
const char* method_context =
"" ) { lock ( lock_Timeout , method_context ); }
29 void lock (
double aLockTimeout ,
const char* method_context =
"" ) {
if ( !mInnerCriticalSection.wait(aLockTimeout) ) { mCheckForDeadlock ( method_context ); } }
30 void unlock ( ) { mInnerCriticalSection.release (); }
32 static double lock_Timeout;
34 void mCheckForDeadlock (
const char* method_context );
#define G_EXC_DEFINE_MSG(aexctypename, abaseexctypename, amsg)
Definition: g_exception_macros.h:43
#define G_EXC_DEFINE(aexctypename, abaseexctypename)
Definition: g_exception_macros.h:39
Definition: g.mthread.ThreadSimpleEvent.h:5
Anchestor Exception class for g::lib.
Definition: g_Exception.h:17
Definition: g_mthread_CriticalSection.h:12
Definition: g_mthread_ObjWithLock.h:19