summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qreadwritelock.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-04-17 16:49:58 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-05-11 12:31:56 -0700
commitfcae43237b7501d9da1dc1b838bf4cdb28d3fd91 (patch)
tree1364665e94d292ca945a275d26dc9b67d0feaaca /src/corelib/thread/qreadwritelock.cpp
parent34914099a1044beba7fdd1b71b079c4130ca0cd4 (diff)
QReadWriteLock: inline the lockForXxx functions
We can now do that because tryLockForXxxx(-1) is fast for the uncontended case too. Change-Id: I3d728c4197df49169066fffd1756ddd06caf7b52 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qreadwritelock.cpp')
-rw-r--r--src/corelib/thread/qreadwritelock.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp
index 7e29aa3905c..36f051408e3 100644
--- a/src/corelib/thread/qreadwritelock.cpp
+++ b/src/corelib/thread/qreadwritelock.cpp
@@ -132,6 +132,7 @@ QReadWriteLock::~QReadWriteLock()
}
/*!
+ \fn QReadWriteLock::lockForRead()
Locks the lock for reading. This function will block the current
thread if another thread has locked for writing.
@@ -140,10 +141,6 @@ QReadWriteLock::~QReadWriteLock()
\sa unlock(), lockForWrite(), tryLockForRead()
*/
-void QReadWriteLock::lockForRead()
-{
- tryLockForRead(-1);
-}
/*!
@@ -229,6 +226,7 @@ Q_NEVER_INLINE static bool contendedTryLockForRead(QAtomicPointer<QReadWriteLock
}
/*!
+ \fn QReadWriteLock::lockForWrite()
Locks the lock for writing. This function will block the current
thread if another thread (including the current) has locked for
reading or writing (unless the lock has been created using the
@@ -239,10 +237,6 @@ Q_NEVER_INLINE static bool contendedTryLockForRead(QAtomicPointer<QReadWriteLock
\sa unlock(), lockForRead(), tryLockForWrite()
*/
-void QReadWriteLock::lockForWrite()
-{
- tryLockForWrite(-1);
-}
/*!
Attempts to lock for writing. This function returns \c true if the