From 0b1b06ffc0a334263c01e32e5bfb50b4d96ba70d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 25 Apr 2016 16:42:11 -0700 Subject: Add a QMutex::isRecursive() const noexcept This is source- and binary-compatible, including the marking of the existing function as noexcept. [ChangeLog][QtCore][QMutex] Made the isRecursive() method be a const function so that it can be called in const QMutex objects too. Change-Id: Ifea6e497f11a461db432ffff1448bead97c08f92 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/thread/qmutex.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/corelib/thread/qmutex.cpp') diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 8d9fa82a7a5..0b14ec31c2b 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -282,19 +282,22 @@ void QMutex::unlock() Q_DECL_NOTHROW unlockInternal(); } +bool QBasicMutex::isRecursive() Q_DECL_NOTHROW +{ + return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire()); +} + /*! - \fn void QMutex::isRecursive() - \since 5.0 + \overload + \since 5.7 Returns \c true if the mutex is recursive - */ -bool QBasicMutex::isRecursive() +bool QBasicMutex::isRecursive() const Q_DECL_NOTHROW { return QT_PREPEND_NAMESPACE(isRecursive)(d_ptr.loadAcquire()); } - /*! \class QMutexLocker \inmodule QtCore -- cgit v1.2.3