Port some trivial cases from QMutex to QRecursiveMutex
In all of these cases, the effect of the change is local to one file. Change-Id: I3bda3aadee3b42e7797183c2330183390b92d1f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
95310aac6d
commit
cd113d0dcb
|
|
@ -197,13 +197,13 @@ Q_DECLARE_TYPEINFO(QResourceRoot, Q_MOVABLE_TYPE);
|
|||
typedef QList<QResourceRoot*> ResourceList;
|
||||
struct QResourceGlobalData
|
||||
{
|
||||
QMutex resourceMutex{QMutex::Recursive};
|
||||
QRecursiveMutex resourceMutex;
|
||||
ResourceList resourceList;
|
||||
QStringList resourceSearchPaths;
|
||||
};
|
||||
Q_GLOBAL_STATIC(QResourceGlobalData, resourceGlobalData)
|
||||
|
||||
static inline QMutex *resourceMutex()
|
||||
static inline QRecursiveMutex *resourceMutex()
|
||||
{ return &resourceGlobalData->resourceMutex; }
|
||||
|
||||
static inline ResourceList *resourceList()
|
||||
|
|
|
|||
|
|
@ -2657,7 +2657,7 @@ QString QCoreApplication::applicationVersion()
|
|||
|
||||
#if QT_CONFIG(library)
|
||||
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
|
||||
Q_GLOBAL_STATIC(QRecursiveMutex, libraryPathMutex)
|
||||
|
||||
/*!
|
||||
Returns a list of paths that the application will search when
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public:
|
|||
|
||||
Q_GLOBAL_STATIC(QList<QFactoryLoader *>, qt_factory_loaders)
|
||||
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, qt_factoryloader_mutex, (QMutex::Recursive))
|
||||
Q_GLOBAL_STATIC(QRecursiveMutex, qt_factoryloader_mutex)
|
||||
|
||||
QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1667,11 +1667,6 @@ bool operator!=(const QGLFormat& a, const QGLFormat& b)
|
|||
}
|
||||
|
||||
struct QGLContextGroupList {
|
||||
QGLContextGroupList()
|
||||
: m_mutex(QMutex::Recursive)
|
||||
{
|
||||
}
|
||||
|
||||
void append(QGLContextGroup *group) {
|
||||
QMutexLocker locker(&m_mutex);
|
||||
m_list.append(group);
|
||||
|
|
@ -1683,7 +1678,7 @@ struct QGLContextGroupList {
|
|||
}
|
||||
|
||||
QList<QGLContextGroup *> m_list;
|
||||
QMutex m_mutex;
|
||||
QRecursiveMutex m_mutex;
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(QGLContextGroupList, qt_context_groups)
|
||||
|
|
|
|||
|
|
@ -116,11 +116,11 @@ private:
|
|||
friend class QFontEngineFT;
|
||||
friend class QtFreetypeData;
|
||||
friend struct QScopedPointerDeleter<QFreetypeFace>;
|
||||
QFreetypeFace() : _lock(QMutex::Recursive) {}
|
||||
QFreetypeFace() = default;
|
||||
~QFreetypeFace() {}
|
||||
void cleanup();
|
||||
QAtomicInt ref;
|
||||
QMutex _lock;
|
||||
QRecursiveMutex _lock;
|
||||
QByteArray fontData;
|
||||
|
||||
QFontEngine::Holder hbFace;
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@ namespace QtAndroidMenu
|
|||
{
|
||||
static QList<QAndroidPlatformMenu *> pendingContextMenus;
|
||||
static QAndroidPlatformMenu *visibleMenu = 0;
|
||||
static QMutex visibleMenuMutex(QMutex::Recursive);
|
||||
static QRecursiveMutex visibleMenuMutex;
|
||||
|
||||
static QSet<QAndroidPlatformMenuBar *> menuBars;
|
||||
static QAndroidPlatformMenuBar *visibleMenuBar = 0;
|
||||
static QWindow *activeTopLevelWindow = 0;
|
||||
static QMutex menuBarMutex(QMutex::Recursive);
|
||||
static QRecursiveMutex menuBarMutex;
|
||||
|
||||
static jmethodID openContextMenuMethodID = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
class tst_QMutexLockerThread : public QThread
|
||||
{
|
||||
public:
|
||||
QMutex mutex;
|
||||
QRecursiveMutex mutex;
|
||||
QSemaphore semaphore, testSemaphore;
|
||||
|
||||
void waitForTest()
|
||||
|
|
@ -45,10 +45,6 @@ public:
|
|||
testSemaphore.acquire();
|
||||
}
|
||||
|
||||
tst_QMutexLockerThread()
|
||||
: mutex(QMutex::Recursive)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class tst_QMutexLocker : public QObject
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include "qmutex.h"
|
||||
|
||||
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, onceInitializationMutex, (QMutex::Recursive))
|
||||
Q_GLOBAL_STATIC(QRecursiveMutex, onceInitializationMutex)
|
||||
|
||||
enum QOnceExtra {
|
||||
MustRunCode = 0x01,
|
||||
|
|
|
|||
Loading…
Reference in New Issue