From 9605f4f47bf4b628aa2b316617178b7b123456d3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 29 Nov 2016 11:43:40 +0100 Subject: doc: clangqdoc documents the threads case qmutex.h is updated to let clangqdoc document the threads case, because the no-threads case is not interesting, and clang can handle everything declared in qmutex.h. This change required that a few minor qdoc errors be corrected in qmutex.cpp as well. Change-Id: Icb4122f2179d6aad39dc68376498364820143297 Reviewed-by: Martin Smith --- src/corelib/thread/qmutex.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/corelib/thread/qmutex.h') diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 056ebdeaa5..12987f16c3 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -54,7 +54,7 @@ class tst_QMutex; QT_BEGIN_NAMESPACE -#if !defined(QT_NO_THREAD) && !defined(Q_QDOC) +#if !defined(QT_NO_THREAD) || defined(Q_CLANG_QDOC) #ifdef Q_OS_LINUX # define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW @@ -189,6 +189,7 @@ private: class Q_CORE_EXPORT QMutexLocker { public: +#ifndef Q_CLANG_QDOC inline explicit QMutexLocker(QBasicMutex *m) QT_MUTEX_LOCK_NOEXCEPT { Q_ASSERT_X((reinterpret_cast(m) & quintptr(1u)) == quintptr(0), @@ -200,6 +201,9 @@ public: val |= 1; } } +#else + QMutexLocker(QMutex *) { } +#endif inline ~QMutexLocker() { unlock(); } inline void unlock() Q_DECL_NOTHROW @@ -240,7 +244,7 @@ private: quintptr val; }; -#else // QT_NO_THREAD or Q_QDOC +#else // QT_NO_THREAD && !Q_CLANG_QDOC class Q_CORE_EXPORT QMutex { @@ -255,7 +259,7 @@ public: inline void unlock() Q_DECL_NOTHROW {} inline bool isRecursive() const Q_DECL_NOTHROW { return true; } -#if QT_HAS_INCLUDE() || defined(Q_QDOC) +#if QT_HAS_INCLUDE() template inline bool try_lock_for(std::chrono::duration duration) Q_DECL_NOTHROW { @@ -291,7 +295,7 @@ private: typedef QMutex QBasicMutex; -#endif // QT_NO_THREAD or Q_QDOC +#endif // QT_NO_THREAD && !Q_CLANG_QDOC QT_END_NAMESPACE -- cgit v1.2.3