summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qmutexpool_p.h
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-16 12:25:24 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-06-16 12:25:24 +0000
commit3d8c8daae109fbd6d60e43c3d4457b581e5e62a3 (patch)
tree84bb5a5f766ce04ff4d243a38ce5e408db5e7782 /src/corelib/thread/qmutexpool_p.h
parent874eb8b44b3ca9cfab63372af10886d16dfc327d (diff)
parentc4e472ea1037afde7b99d9132a49eb616cad240e (diff)
Merge "Merge remote-tracking branch 'origin/5.7.0' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/corelib/thread/qmutexpool_p.h')
-rw-r--r--src/corelib/thread/qmutexpool_p.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h
index 33e9a52cb7..796e65d960 100644
--- a/src/corelib/thread/qmutexpool_p.h
+++ b/src/corelib/thread/qmutexpool_p.h
@@ -66,7 +66,7 @@ public:
~QMutexPool();
inline QMutex *get(const void *address) {
- int index = uint(quintptr(address)) % count;
+ int index = uint(quintptr(address)) % mutexes.count();
QMutex *m = mutexes[index].load();
if (m)
return m;
@@ -78,8 +78,7 @@ public:
private:
QMutex *createMutex(int index);
- int count;
- QAtomicPointer<QMutex> *mutexes;
+ QVarLengthArray<QAtomicPointer<QMutex>, 131> mutexes;
QMutex::RecursionMode recursionMode;
};