From a3bb85673a4bf9aa7c629ab74b483a2faaa30369 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 27 Mar 2009 15:19:36 +0100 Subject: 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 --- src/corelib/thread/qmutexpool_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/thread/qmutexpool_p.h') 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, 128> mutexes; int count; bool recurs; }; -- cgit v1.2.1