summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex.h
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-07 11:57:01 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-07 15:11:06 (GMT)
commitdce6cb12d22d7356fc2d45fd81f2797f9ae44190 (patch)
treeaacbe372caab00c30d8ccf574bfae9809fd1bb71 /src/corelib/thread/qmutex.h
parenta77ab4c4dd3c0d9c5cf71afc4d3efcc76a068430 (diff)
downloadQt-dce6cb12d22d7356fc2d45fd81f2797f9ae44190.zip
Qt-dce6cb12d22d7356fc2d45fd81f2797f9ae44190.tar.gz
Qt-dce6cb12d22d7356fc2d45fd81f2797f9ae44190.tar.bz2
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
Diffstat (limited to 'src/corelib/thread/qmutex.h')
-rw-r--r--src/corelib/thread/qmutex.h9
1 files changed, 8 insertions, 1 deletions
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