summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutex.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-03-06 14:31:49 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2022-03-15 03:32:14 +0100
commit9b8015ed8d4dcfc3ac3dd15fb5a2edf16ff639db (patch)
tree1b301b286ff19e6605860ab4744e49dbe4c8ccf1 /src/corelib/thread/qmutex.h
parent07b176ce70009f62fbce603c0495fa36c23b10d7 (diff)
QMutexLocker: add isLocked()
It's basically for free. [ChangeLog][QtCore][QMutexLocker] Added the isLocked() function. Change-Id: Idad5fa249ba8f135dcf81c7b7596caa3a888e99c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread/qmutex.h')
-rw-r--r--src/corelib/thread/qmutex.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h
index fea3657150..f57a95de22 100644
--- a/src/corelib/thread/qmutex.h
+++ b/src/corelib/thread/qmutex.h
@@ -252,6 +252,11 @@ public:
unlock();
}
+ inline bool isLocked() const noexcept
+ {
+ return m_isLocked;
+ }
+
inline void unlock() noexcept
{
if (!m_isLocked)