|
|
@ -27,6 +27,10 @@ void static inline EnterCritical(const char* pszName, const char* pszFile, int n |
|
|
|
void static inline LeaveCritical() {} |
|
|
|
void static inline LeaveCritical() {} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DEBUG_LOCKCONTENTION |
|
|
|
|
|
|
|
void PrintLockContention(const char* pszName, const char* pszFile, int nLine); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
/** Wrapper around boost::interprocess::scoped_lock */ |
|
|
|
/** Wrapper around boost::interprocess::scoped_lock */ |
|
|
|
template<typename Mutex> |
|
|
|
template<typename Mutex> |
|
|
|
class CMutexLock |
|
|
|
class CMutexLock |
|
|
@ -43,8 +47,7 @@ public: |
|
|
|
#ifdef DEBUG_LOCKCONTENTION |
|
|
|
#ifdef DEBUG_LOCKCONTENTION |
|
|
|
if (!lock.try_lock()) |
|
|
|
if (!lock.try_lock()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
printf("LOCKCONTENTION: %s\n", pszName); |
|
|
|
PrintLockContention(pszName, pszFile, nLine); |
|
|
|
printf("Locker: %s:%d\n", pszFile, nLine); |
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
lock.lock(); |
|
|
|
lock.lock(); |
|
|
|
#ifdef DEBUG_LOCKCONTENTION |
|
|
|
#ifdef DEBUG_LOCKCONTENTION |
|
|
|