From dce6cb12d22d7356fc2d45fd81f2797f9ae44190 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 7 Feb 2011 12:57:01 +0100 Subject: QMutex: do not use inline mutex in debug. Debugger tools (such as valgrind) hooks into QMutex::lock and QMutex::unlock. So we should continue to call this function if we want to keep those tools working Reviewed-by: brad --- src/corelib/thread/qmutex.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index dfe4aae..5f75195 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -163,6 +163,7 @@ class QMutexData ~QMutexData(); }; +#ifdef QT_NO_DEBUG inline void QMutex::unlockInline() { if (d->recursive) { @@ -189,7 +190,13 @@ inline void QMutex::lockInline() lockInternal(); } } - +#else // QT_NO_DEBUG +//in debug we do not use inline calls in order to allow debugging tools +// to hook the mutex locking functions. +inline void QMutex::unlockInline() { unlock(); } +inline bool QMutex::tryLockInline() { return tryLock(); } +inline void QMutex::lockInline() { lock(); } +#endif // QT_NO_DEBUG #else // QT_NO_THREAD -- cgit v0.12