diff options
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 16 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_p.h | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 12 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 8e349f23ce..6737aeccd2 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -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() { diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index a707ea64ee..a8db108eeb 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -405,10 +405,10 @@ inline void QLibraryStore::cleanup() LibraryMap::Iterator it = data->libraryMap.begin(); for (; it != data->libraryMap.end(); ++it) { QLibraryPrivate *lib = it.value(); - if (lib->libraryRefCount.load() == 1) { - if (lib->libraryUnloadCount.load() > 0) { + if (lib->libraryRefCount.loadRelaxed() == 1) { + if (lib->libraryUnloadCount.loadRelaxed() > 0) { Q_ASSERT(lib->pHnd); - lib->libraryUnloadCount.store(1); + lib->libraryUnloadCount.storeRelaxed(1); #ifdef __GLIBC__ // glibc has a bug in unloading from global destructors // see https://bugzilla.novell.com/show_bug.cgi?id=622977 @@ -428,7 +428,7 @@ inline void QLibraryStore::cleanup() for (QLibraryPrivate *lib : qAsConst(data->libraryMap)) { if (lib) qDebug() << "On QtCore unload," << lib->fileName << "was leaked, with" - << lib->libraryRefCount.load() << "users"; + << lib->libraryRefCount.loadRelaxed() << "users"; } } @@ -487,7 +487,7 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib) } // no one else is using - Q_ASSERT(lib->libraryUnloadCount.load() == 0); + Q_ASSERT(lib->libraryUnloadCount.loadRelaxed() == 0); if (Q_LIKELY(data) && !lib->fileName.isEmpty()) { QLibraryPrivate *that = data->libraryMap.take(lib->fileName); @@ -501,7 +501,7 @@ QLibraryPrivate::QLibraryPrivate(const QString &canonicalFileName, const QString : pHnd(0), fileName(canonicalFileName), fullVersion(version), instance(0), libraryRefCount(0), libraryUnloadCount(0), pluginState(MightBeAPlugin) { - loadHintsInt.store(loadHints); + loadHintsInt.storeRelaxed(loadHints); if (canonicalFileName.isEmpty()) errorString = QLibrary::tr("The shared library was not found."); } @@ -522,7 +522,7 @@ void QLibraryPrivate::mergeLoadHints(QLibrary::LoadHints lh) if (pHnd) return; - loadHintsInt.store(lh); + loadHintsInt.storeRelaxed(lh); } QFunctionPointer QLibraryPrivate::resolve(const char *symbol) @@ -575,7 +575,7 @@ bool QLibraryPrivate::unload(UnloadFlag flag) { if (!pHnd) return false; - if (libraryUnloadCount.load() > 0 && !libraryUnloadCount.deref()) { // only unload if ALL QLibrary instance wanted to + if (libraryUnloadCount.loadRelaxed() > 0 && !libraryUnloadCount.deref()) { // only unload if ALL QLibrary instance wanted to delete inst.data(); if (flag == NoUnloadSys || unload_sys()) { if (qt_debug_component()) diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h index 1a216c98b5..db5afac98e 100644 --- a/src/corelib/plugin/qlibrary_p.h +++ b/src/corelib/plugin/qlibrary_p.h @@ -92,7 +92,7 @@ public: QFunctionPointer resolve(const char *); QLibrary::LoadHints loadHints() const - { return QLibrary::LoadHints(loadHintsInt.load()); } + { return QLibrary::LoadHints(loadHintsInt.loadRelaxed()); } void setLoadHints(QLibrary::LoadHints lh); static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString(), diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index e03814984c..84fcc53d52 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -77,14 +77,14 @@ QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion) // .so is preferred. # if defined(__ia64) if (!fullVersion.isEmpty()) { - suffixes << QString::fromLatin1(".so.%1").arg(fullVersion); + suffixes << QLatin1String(".so.%1").arg(fullVersion); } else { suffixes << QLatin1String(".so"); } # endif if (!fullVersion.isEmpty()) { - suffixes << QString::fromLatin1(".sl.%1").arg(fullVersion); - suffixes << QString::fromLatin1(".%1").arg(fullVersion); + suffixes << QLatin1String(".sl.%1").arg(fullVersion); + suffixes << QLatin1String(".%1").arg(fullVersion); } else { suffixes << QLatin1String(".sl"); } @@ -93,15 +93,15 @@ QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion) #else if (!fullVersion.isEmpty()) { - suffixes << QString::fromLatin1(".so.%1").arg(fullVersion); + suffixes << QLatin1String(".so.%1").arg(fullVersion); } else { suffixes << QLatin1String(".so"); } #endif # ifdef Q_OS_MAC if (!fullVersion.isEmpty()) { - suffixes << QString::fromLatin1(".%1.bundle").arg(fullVersion); - suffixes << QString::fromLatin1(".%1.dylib").arg(fullVersion); + suffixes << QLatin1String(".%1.bundle").arg(fullVersion); + suffixes << QLatin1String(".%1.dylib").arg(fullVersion); } else { suffixes << QLatin1String(".bundle") << QLatin1String(".dylib"); } |