2011-04-27 10:05:43 +00:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
2016-01-15 07:08:27 +00:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
|
|
|
** This file is part of the QtCore module of the Qt Toolkit.
|
|
|
|
**
|
2016-01-15 07:08:27 +00:00
|
|
|
** $QT_BEGIN_LICENSE:LGPL$
|
2012-09-19 12:28:29 +00:00
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-28 08:44:43 +00:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
2016-01-15 07:08:27 +00:00
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2012-09-19 12:28:29 +00:00
|
|
|
**
|
2011-04-27 10:05:43 +00:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-09-19 12:28:29 +00:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2016-01-15 07:08:27 +00:00
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU Lesser General Public License version 3 requirements
|
|
|
|
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
2016-01-15 07:08:27 +00:00
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 2.0 or (at your option) the GNU General
|
|
|
|
** Public license version 3 or any later version approved by the KDE Free
|
|
|
|
** Qt Foundation. The licenses are as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
|
|
|
** https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-04-27 10:05:43 +00:00
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QMUTEX_H
|
|
|
|
#define QMUTEX_H
|
|
|
|
|
|
|
|
#include <QtCore/qglobal.h>
|
|
|
|
#include <QtCore/qatomic.h>
|
|
|
|
#include <new>
|
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
#if QT_HAS_INCLUDE(<chrono>)
|
|
|
|
# include <chrono>
|
QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as
mutex.try_lock_for(10us)
to compile, which is misleading, since it's actually a zero-
timeout try_lock().
Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.
Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.
In the above example, the try_lock_for call is now equivalent
to
mutex.tryLock(1);
The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.
Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-17 11:00:04 +00:00
|
|
|
# include <limits>
|
2016-07-14 14:37:55 +00:00
|
|
|
#endif
|
|
|
|
|
QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as
mutex.try_lock_for(10us)
to compile, which is misleading, since it's actually a zero-
timeout try_lock().
Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.
Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.
In the above example, the try_lock_for call is now equivalent
to
mutex.tryLock(1);
The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.
Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-17 11:00:04 +00:00
|
|
|
class tst_QMutex;
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
|
|
|
|
2016-12-29 16:11:24 +00:00
|
|
|
#if QT_CONFIG(thread) || defined(Q_CLANG_QDOC)
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2012-08-02 14:15:22 +00:00
|
|
|
#ifdef Q_OS_LINUX
|
|
|
|
# define QT_MUTEX_LOCK_NOEXCEPT Q_DECL_NOTHROW
|
|
|
|
#else
|
|
|
|
# define QT_MUTEX_LOCK_NOEXCEPT
|
|
|
|
#endif
|
|
|
|
|
2011-10-20 15:11:18 +00:00
|
|
|
class QMutexData;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2011-07-02 13:13:12 +00:00
|
|
|
class Q_CORE_EXPORT QBasicMutex
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-11-12 22:15:28 +00:00
|
|
|
#ifdef Q_COMPILER_CONSTEXPR
|
|
|
|
constexpr QBasicMutex()
|
|
|
|
: d_ptr(nullptr)
|
|
|
|
{}
|
|
|
|
#endif
|
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
// BasicLockable concept
|
2012-08-02 14:15:22 +00:00
|
|
|
inline void lock() QT_MUTEX_LOCK_NOEXCEPT {
|
2011-07-02 13:13:12 +00:00
|
|
|
if (!fastTryLock())
|
|
|
|
lockInternal();
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
// BasicLockable concept
|
2012-08-02 14:15:22 +00:00
|
|
|
inline void unlock() Q_DECL_NOTHROW {
|
2011-10-28 09:51:06 +00:00
|
|
|
Q_ASSERT(d_ptr.load()); //mutex must be locked
|
2012-08-11 14:45:14 +00:00
|
|
|
if (!fastTryUnlock())
|
2011-07-02 13:13:12 +00:00
|
|
|
unlockInternal();
|
|
|
|
}
|
|
|
|
|
2012-08-11 16:18:27 +00:00
|
|
|
bool tryLock() Q_DECL_NOTHROW {
|
|
|
|
return fastTryLock();
|
2011-07-02 13:13:12 +00:00
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
// Lockable concept
|
|
|
|
bool try_lock() Q_DECL_NOTHROW { return tryLock(); }
|
|
|
|
|
2016-04-25 23:42:11 +00:00
|
|
|
bool isRecursive() Q_DECL_NOTHROW; //### Qt6: remove me
|
|
|
|
bool isRecursive() const Q_DECL_NOTHROW;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
2012-08-02 14:15:22 +00:00
|
|
|
inline bool fastTryLock() Q_DECL_NOTHROW {
|
2017-09-18 09:49:52 +00:00
|
|
|
return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
|
2011-07-02 13:13:12 +00:00
|
|
|
}
|
2012-08-11 14:45:14 +00:00
|
|
|
inline bool fastTryUnlock() Q_DECL_NOTHROW {
|
2017-09-18 09:49:52 +00:00
|
|
|
return d_ptr.testAndSetRelease(dummyLocked(), nullptr);
|
2012-08-11 14:45:14 +00:00
|
|
|
}
|
2012-08-16 15:15:33 +00:00
|
|
|
inline bool fastTryLock(QMutexData *¤t) Q_DECL_NOTHROW {
|
2017-09-18 09:49:52 +00:00
|
|
|
return d_ptr.testAndSetAcquire(nullptr, dummyLocked(), current);
|
2012-08-16 15:15:33 +00:00
|
|
|
}
|
|
|
|
inline bool fastTryUnlock(QMutexData *¤t) Q_DECL_NOTHROW {
|
2017-09-18 09:49:52 +00:00
|
|
|
return d_ptr.testAndSetRelease(dummyLocked(), nullptr, current);
|
2012-08-16 15:15:33 +00:00
|
|
|
}
|
2012-08-11 14:45:14 +00:00
|
|
|
|
2012-08-11 10:18:45 +00:00
|
|
|
void lockInternal() QT_MUTEX_LOCK_NOEXCEPT;
|
|
|
|
bool lockInternal(int timeout) QT_MUTEX_LOCK_NOEXCEPT;
|
2012-08-02 14:15:22 +00:00
|
|
|
void unlockInternal() Q_DECL_NOTHROW;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2011-10-20 15:11:18 +00:00
|
|
|
QBasicAtomicPointer<QMutexData> d_ptr;
|
|
|
|
static inline QMutexData *dummyLocked() {
|
|
|
|
return reinterpret_cast<QMutexData *>(quintptr(1));
|
2011-07-02 13:13:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
friend class QMutex;
|
2011-10-20 15:11:18 +00:00
|
|
|
friend class QMutexData;
|
2011-07-02 13:13:12 +00:00
|
|
|
};
|
|
|
|
|
2016-04-25 23:42:11 +00:00
|
|
|
class Q_CORE_EXPORT QMutex : public QBasicMutex
|
|
|
|
{
|
2011-07-02 13:13:12 +00:00
|
|
|
public:
|
|
|
|
enum RecursionMode { NonRecursive, Recursive };
|
|
|
|
explicit QMutex(RecursionMode mode = NonRecursive);
|
|
|
|
~QMutex();
|
2012-05-23 08:26:07 +00:00
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
// BasicLockable concept
|
2012-08-02 14:15:22 +00:00
|
|
|
void lock() QT_MUTEX_LOCK_NOEXCEPT;
|
|
|
|
bool tryLock(int timeout = 0) QT_MUTEX_LOCK_NOEXCEPT;
|
2016-07-14 14:37:55 +00:00
|
|
|
// BasicLockable concept
|
2012-08-02 14:15:22 +00:00
|
|
|
void unlock() Q_DECL_NOTHROW;
|
2012-05-23 08:26:07 +00:00
|
|
|
|
2016-07-14 14:37:55 +00:00
|
|
|
// Lockable concept
|
|
|
|
bool try_lock() QT_MUTEX_LOCK_NOEXCEPT { return tryLock(); }
|
|
|
|
|
2018-01-03 12:21:57 +00:00
|
|
|
#if QT_HAS_INCLUDE(<chrono>) || defined(Q_CLANG_QDOC)
|
2016-07-14 14:37:55 +00:00
|
|
|
// TimedLockable concept
|
|
|
|
template <class Rep, class Period>
|
|
|
|
bool try_lock_for(std::chrono::duration<Rep, Period> duration)
|
|
|
|
{
|
QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as
mutex.try_lock_for(10us)
to compile, which is misleading, since it's actually a zero-
timeout try_lock().
Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.
Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.
In the above example, the try_lock_for call is now equivalent
to
mutex.tryLock(1);
The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.
Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-17 11:00:04 +00:00
|
|
|
return tryLock(convertToMilliseconds(duration));
|
2016-07-14 14:37:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TimedLockable concept
|
|
|
|
template<class Clock, class Duration>
|
|
|
|
bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint)
|
|
|
|
{
|
|
|
|
// Implemented in terms of try_lock_for to honor the similar
|
2016-09-13 21:20:37 +00:00
|
|
|
// requirement in N4606 § 30.4.1.3 [thread.timedmutex.requirements]/12.
|
2016-07-14 14:37:55 +00:00
|
|
|
|
|
|
|
return try_lock_for(timePoint - Clock::now());
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-04-25 23:42:11 +00:00
|
|
|
bool isRecursive() const Q_DECL_NOTHROW
|
|
|
|
{ return QBasicMutex::isRecursive(); }
|
2012-05-23 08:26:07 +00:00
|
|
|
|
2011-07-02 13:13:12 +00:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(QMutex)
|
2012-05-23 08:26:07 +00:00
|
|
|
friend class QMutexLocker;
|
QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as
mutex.try_lock_for(10us)
to compile, which is misleading, since it's actually a zero-
timeout try_lock().
Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.
Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.
In the above example, the try_lock_for call is now equivalent
to
mutex.tryLock(1);
The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.
Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-17 11:00:04 +00:00
|
|
|
friend class ::tst_QMutex;
|
|
|
|
|
|
|
|
#if QT_HAS_INCLUDE(<chrono>)
|
|
|
|
template<class Rep, class Period>
|
|
|
|
static int convertToMilliseconds(std::chrono::duration<Rep, Period> duration)
|
|
|
|
{
|
|
|
|
// N4606 § 30.4.1.3.5 [thread.timedmutex.requirements] specifies that a
|
|
|
|
// duration less than or equal to duration.zero() shall result in a
|
|
|
|
// try_lock, unlike QMutex's tryLock with a negative duration which
|
|
|
|
// results in a lock.
|
|
|
|
|
|
|
|
if (duration <= duration.zero())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// when converting from 'duration' to milliseconds, make sure that
|
|
|
|
// the result is not shorter than 'duration':
|
|
|
|
std::chrono::milliseconds wait = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
|
|
|
|
if (wait < duration)
|
|
|
|
wait += std::chrono::milliseconds(1);
|
|
|
|
Q_ASSERT(wait >= duration);
|
|
|
|
const auto ms = wait.count();
|
|
|
|
const auto maxInt = (std::numeric_limits<int>::max)();
|
|
|
|
|
|
|
|
return ms < maxInt ? int(ms) : maxInt;
|
|
|
|
}
|
|
|
|
#endif
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class Q_CORE_EXPORT QMutexLocker
|
|
|
|
{
|
|
|
|
public:
|
2016-11-29 10:43:40 +00:00
|
|
|
#ifndef Q_CLANG_QDOC
|
2012-08-02 14:15:22 +00:00
|
|
|
inline explicit QMutexLocker(QBasicMutex *m) QT_MUTEX_LOCK_NOEXCEPT
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
Q_ASSERT_X((reinterpret_cast<quintptr>(m) & quintptr(1u)) == quintptr(0),
|
|
|
|
"QMutexLocker", "QMutex pointer is misaligned");
|
2012-05-23 08:26:07 +00:00
|
|
|
val = quintptr(m);
|
2012-08-01 15:54:32 +00:00
|
|
|
if (Q_LIKELY(m)) {
|
|
|
|
// call QMutex::lock() instead of QBasicMutex::lock()
|
|
|
|
static_cast<QMutex *>(m)->lock();
|
|
|
|
val |= 1;
|
|
|
|
}
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
2016-11-29 10:43:40 +00:00
|
|
|
#else
|
|
|
|
QMutexLocker(QMutex *) { }
|
|
|
|
#endif
|
2011-04-27 10:05:43 +00:00
|
|
|
inline ~QMutexLocker() { unlock(); }
|
|
|
|
|
2012-08-02 14:15:22 +00:00
|
|
|
inline void unlock() Q_DECL_NOTHROW
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
if ((val & quintptr(1u)) == quintptr(1u)) {
|
|
|
|
val &= ~quintptr(1u);
|
2011-07-02 13:13:12 +00:00
|
|
|
mutex()->unlock();
|
2011-04-27 10:05:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-02 14:15:22 +00:00
|
|
|
inline void relock() QT_MUTEX_LOCK_NOEXCEPT
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
if (val) {
|
|
|
|
if ((val & quintptr(1u)) == quintptr(0u)) {
|
2011-07-02 13:13:12 +00:00
|
|
|
mutex()->lock();
|
2011-04-27 10:05:43 +00:00
|
|
|
val |= quintptr(1u);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(Q_CC_MSVC)
|
|
|
|
#pragma warning( push )
|
|
|
|
#pragma warning( disable : 4312 ) // ignoring the warning from /Wp64
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline QMutex *mutex() const
|
|
|
|
{
|
|
|
|
return reinterpret_cast<QMutex *>(val & ~quintptr(1u));
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(Q_CC_MSVC)
|
|
|
|
#pragma warning( pop )
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(QMutexLocker)
|
|
|
|
|
|
|
|
quintptr val;
|
|
|
|
};
|
|
|
|
|
2016-12-29 16:11:24 +00:00
|
|
|
#else // !QT_CONFIG(thread) && !Q_CLANG_QDOC
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
class Q_CORE_EXPORT QMutex
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum RecursionMode { NonRecursive, Recursive };
|
|
|
|
|
2017-10-19 02:00:40 +00:00
|
|
|
inline Q_DECL_CONSTEXPR explicit QMutex(RecursionMode = NonRecursive) Q_DECL_NOTHROW { }
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-01-08 14:03:39 +00:00
|
|
|
inline void lock() Q_DECL_NOTHROW {}
|
|
|
|
inline bool tryLock(int timeout = 0) Q_DECL_NOTHROW { Q_UNUSED(timeout); return true; }
|
2016-07-14 14:37:55 +00:00
|
|
|
inline bool try_lock() Q_DECL_NOTHROW { return true; }
|
2015-01-08 14:03:39 +00:00
|
|
|
inline void unlock() Q_DECL_NOTHROW {}
|
2016-04-25 23:42:11 +00:00
|
|
|
inline bool isRecursive() const Q_DECL_NOTHROW { return true; }
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2016-11-29 10:43:40 +00:00
|
|
|
#if QT_HAS_INCLUDE(<chrono>)
|
2016-07-14 14:37:55 +00:00
|
|
|
template <class Rep, class Period>
|
|
|
|
inline bool try_lock_for(std::chrono::duration<Rep, Period> duration) Q_DECL_NOTHROW
|
|
|
|
{
|
|
|
|
Q_UNUSED(duration);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<class Clock, class Duration>
|
|
|
|
inline bool try_lock_until(std::chrono::time_point<Clock, Duration> timePoint) Q_DECL_NOTHROW
|
|
|
|
{
|
|
|
|
Q_UNUSED(timePoint);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-04-27 10:05:43 +00:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(QMutex)
|
|
|
|
};
|
|
|
|
|
|
|
|
class Q_CORE_EXPORT QMutexLocker
|
|
|
|
{
|
|
|
|
public:
|
2015-01-08 14:03:39 +00:00
|
|
|
inline explicit QMutexLocker(QMutex *) Q_DECL_NOTHROW {}
|
|
|
|
inline ~QMutexLocker() Q_DECL_NOTHROW {}
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2015-01-08 14:03:39 +00:00
|
|
|
inline void unlock() Q_DECL_NOTHROW {}
|
|
|
|
void relock() Q_DECL_NOTHROW {}
|
2017-09-18 09:49:52 +00:00
|
|
|
inline QMutex *mutex() const Q_DECL_NOTHROW { return nullptr; }
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(QMutexLocker)
|
|
|
|
};
|
|
|
|
|
2011-07-02 13:13:12 +00:00
|
|
|
typedef QMutex QBasicMutex;
|
|
|
|
|
2016-12-29 16:11:24 +00:00
|
|
|
#endif // !QT_CONFIG(thread) && !Q_CLANG_QDOC
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
#endif // QMUTEX_H
|