diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-22 12:30:27 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-22 12:35:45 (GMT) |
commit | 3ebbecd49d9e3cd8818634d5da5c7b1850190d54 (patch) | |
tree | 51abbce383aa517c03ff85c3def557a380c01fc4 /src/corelib/thread/qmutexpool_p.h | |
parent | d001cef792b2f41615cb1f7657bed3d7525ffb0e (diff) | |
download | Qt-3ebbecd49d9e3cd8818634d5da5c7b1850190d54.zip Qt-3ebbecd49d9e3cd8818634d5da5c7b1850190d54.tar.gz Qt-3ebbecd49d9e3cd8818634d5da5c7b1850190d54.tar.bz2 |
Make the default size of QMutexPool a prime number
As pointed out by Olivier, this should allow for better distribution
in the array.
I also removed the unnecessary count member, since we can use
QVarLengthArray.count() instead.
Diffstat (limited to 'src/corelib/thread/qmutexpool_p.h')
-rw-r--r-- | src/corelib/thread/qmutexpool_p.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h index 4c1e32c..30a16d4 100644 --- a/src/corelib/thread/qmutexpool_p.h +++ b/src/corelib/thread/qmutexpool_p.h @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE class Q_CORE_EXPORT QMutexPool { public: - explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 128); + explicit QMutexPool(QMutex::RecursionMode recursionMode = QMutex::NonRecursive, int size = 131); ~QMutexPool(); QMutex *get(const void *address); @@ -72,8 +72,7 @@ public: static QMutex *globalInstanceGet(const void *address); private: - QVarLengthArray<QAtomicPointer<QMutex>, 128> mutexes; - int count; + QVarLengthArray<QAtomicPointer<QMutex>, 131> mutexes; QMutex::RecursionMode recursionMode; }; |