diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-03-27 15:19:36 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-03-27 16:45:18 +0100 |
commit | a3bb85673a4bf9aa7c629ab74b483a2faaa30369 (patch) | |
tree | 272a297ac872ca30eb094ea01b0911de453ca0bb /src/corelib/thread/qmutexpool_p.h | |
parent | 43c5656d834739e86f2895cfbf3d539bb8c7c498 (diff) | |
download | qt4-tools-a3bb85673a4bf9aa7c629ab74b483a2faaa30369.tar.gz |
Make QMutexPool actually be thread-safe (double-checked locking doesn't
work)
This code was apparently mostly unchanged since 2005. Update it to match
the atomics code.
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/thread/qmutexpool_p.h')
-rw-r--r-- | src/corelib/thread/qmutexpool_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/thread/qmutexpool_p.h b/src/corelib/thread/qmutexpool_p.h index 65a3b543fe..4b91e5ba63 100644 --- a/src/corelib/thread/qmutexpool_p.h +++ b/src/corelib/thread/qmutexpool_p.h @@ -54,6 +54,7 @@ // #include "QtCore/qmutex.h" +#include "QtCore/qvarlengtharray.h" #ifndef QT_NO_THREAD @@ -70,8 +71,7 @@ public: static QMutex *globalInstanceGet(const void *address); private: - QMutex mutex; - QMutex **mutexes; + QVarLengthArray<QAtomicPointer<QMutex>, 128> mutexes; int count; bool recurs; }; |