diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-22 01:23:24 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-22 01:42:03 (GMT) |
commit | a56597916b275a2f0d2e3b9f8ac3653eeb4e2e91 (patch) | |
tree | b1bfe41a9bd2b0569e1df9fcd662b95272c6156e /src/plugins/bearer/nla | |
parent | 0109df3ee449767c1836ec7028ac219c57cf9ca7 (diff) | |
download | Qt-a56597916b275a2f0d2e3b9f8ac3653eeb4e2e91.zip Qt-a56597916b275a2f0d2e3b9f8ac3653eeb4e2e91.tar.gz Qt-a56597916b275a2f0d2e3b9f8ac3653eeb4e2e91.tar.bz2 |
Add locking to bearer code.
QNetworkConfigurationManagerPrivate and QBearerEngine derived classes
need to be thread-safe.
Diffstat (limited to 'src/plugins/bearer/nla')
-rw-r--r-- | src/plugins/bearer/nla/qnlaengine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp index 2001c0b..ff334e5 100644 --- a/src/plugins/bearer/nla/qnlaengine.cpp +++ b/src/plugins/bearer/nla/qnlaengine.cpp @@ -521,6 +521,8 @@ QNlaEngine::~QNlaEngine() void QNlaEngine::networksChanged() { + QMutexLocker locker(&mutex); + QStringList previous = accessPointConfigurations.keys(); QList<QNetworkConfigurationPrivate *> foundConfigurations = nlaThread->getConfigurations(); @@ -574,11 +576,15 @@ void QNlaEngine::networksChanged() QString QNlaEngine::getInterfaceFromId(const QString &id) { + QMutexLocker locker(&mutex); + return configurationInterface.value(id.toUInt()); } bool QNlaEngine::hasIdentifier(const QString &id) { + QMutexLocker locker(&mutex); + return configurationInterface.contains(id.toUInt()); } @@ -604,11 +610,15 @@ void QNlaEngine::disconnectFromId(const QString &id) void QNlaEngine::requestUpdate() { + QMutexLocker locker(&mutex); + nlaThread->forceUpdate(); } QNetworkSession::State QNlaEngine::sessionStateForId(const QString &id) { + QMutexLocker locker(&mutex); + QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); if (!ptr) |