diff options
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qmutex.h | 6 | ||||
-rw-r--r-- | src/corelib/thread/qsemaphore.h | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 541f6af546..3dff363541 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -67,6 +67,12 @@ class QMutexData; class Q_CORE_EXPORT QBasicMutex { public: +#ifdef Q_COMPILER_CONSTEXPR + constexpr QBasicMutex() + : d_ptr(nullptr) + {} +#endif + // BasicLockable concept inline void lock() QT_MUTEX_LOCK_NOEXCEPT { if (!fastTryLock()) diff --git a/src/corelib/thread/qsemaphore.h b/src/corelib/thread/qsemaphore.h index c41f258577..2639085e99 100644 --- a/src/corelib/thread/qsemaphore.h +++ b/src/corelib/thread/qsemaphore.h @@ -74,8 +74,6 @@ private: class QSemaphoreReleaser { - QSemaphore *m_sem = nullptr; - int m_n; public: QSemaphoreReleaser() = default; explicit QSemaphoreReleaser(QSemaphore &sem, int n = 1) Q_DECL_NOTHROW @@ -109,6 +107,10 @@ public: m_sem = nullptr; return old; } + +private: + QSemaphore *m_sem = nullptr; + int m_n; }; #endif // QT_NO_THREAD |