Skip to content

Commit

Permalink
Document performance of QMutex
Browse files Browse the repository at this point in the history
Change-Id: I4de2fd5ba717975b5de98ffe7ca6348afbed1b2f
Reviewed-by: Marc Mutz <[email protected]>
  • Loading branch information
ogoffart committed Nov 13, 2015
1 parent 1de3fe0 commit 45be405
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/corelib/thread/qmutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ class QRecursiveMutexPrivate : public QMutexData
lock calls unlock(). A non-blocking alternative to lock() is
tryLock().
QMutex is optimized to be fast in the non-contended case. A non-recursive
QMutex will not allocate memory if there is no contention on that mutex.
It is constructed and destroyed with almost no overhead,
which means it is fine to have many mutexes as part of other classes.
\sa QMutexLocker, QReadWriteLock, QSemaphore, QWaitCondition
*/

Expand All @@ -165,6 +170,8 @@ class QRecursiveMutexPrivate : public QMutexData
a thread may only lock a mutex once. The default is
QMutex::NonRecursive.
Recursive mutexes are slower and take more memory than non-recursive ones.
\sa lock(), unlock()
*/
QMutex::QMutex(RecursionMode mode)
Expand Down

0 comments on commit 45be405

Please sign in to comment.