summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-06-17 08:53:34 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-06-21 20:47:19 +0200
commit4a83ce611d91348903882eafe34c35f44bee1776 (patch)
treee1645ad0096229fff35b00b9d24a7780e19c82a8 /src/corelib/plugin/qlibrary_p.h
parent6b15a5a869e6180a000751958def1cf485c23f68 (diff)
Move most of the QLibraryPrivate initialization to its constructor
This commit moves the setting of the loadHints to inside the constructor or to QLibraryStore::findOrCreate (which is under a mutex). This avoids data race conditions with two threads asking for the same plugin at the same time, with different load hints. This also opportunistically moves the setting of the error message for empty file names. Task-number: QTBUG-39642 Change-Id: I497a41781d10e407d6420116a0b05fdfe2b548de Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/plugin/qlibrary_p.h')
-rw-r--r--src/corelib/plugin/qlibrary_p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index 20b0c7e20f..e58d18e87b 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -94,7 +94,8 @@ public:
void release();
QFunctionPointer resolve(const char *);
- static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString());
+ static QLibraryPrivate *findOrCreate(const QString &fileName, const QString &version = QString(),
+ QLibrary::LoadHints loadHints = 0);
static QStringList suffixes_sys(const QString &fullVersion);
static QStringList prefixes_sys();
@@ -117,8 +118,9 @@ public:
}
private:
- explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version);
+ explicit QLibraryPrivate(const QString &canonicalFileName, const QString &version, QLibrary::LoadHints loadHints);
~QLibraryPrivate();
+ void mergeLoadHints(QLibrary::LoadHints loadHints);
bool load_sys();
bool unload_sys();