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/nativewifi | |
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/nativewifi')
-rw-r--r-- | src/plugins/bearer/nativewifi/qnativewifiengine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index e4ab0aa..c8015d8 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -109,6 +109,8 @@ QNativeWifiEngine::~QNativeWifiEngine() void QNativeWifiEngine::scanComplete() { + QMutexLocker locker(&mutex); + QStringList previous = accessPointConfigurations.keys(); // enumerate interfaces @@ -227,6 +229,8 @@ void QNativeWifiEngine::scanComplete() QString QNativeWifiEngine::getInterfaceFromId(const QString &id) { + QMutexLocker locker(&mutex); + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -276,6 +280,8 @@ QString QNativeWifiEngine::getInterfaceFromId(const QString &id) bool QNativeWifiEngine::hasIdentifier(const QString &id) { + QMutexLocker locker(&mutex); + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -330,6 +336,8 @@ bool QNativeWifiEngine::hasIdentifier(const QString &id) void QNativeWifiEngine::connectToId(const QString &id) { + QMutexLocker locker(&mutex); + WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); if (result != ERROR_SUCCESS) { @@ -393,6 +401,8 @@ void QNativeWifiEngine::connectToId(const QString &id) void QNativeWifiEngine::disconnectFromId(const QString &id) { + QMutexLocker locker(&mutex); + QString interface = getInterfaceFromId(id); if (interface.isEmpty()) { @@ -421,6 +431,8 @@ void QNativeWifiEngine::disconnectFromId(const QString &id) void QNativeWifiEngine::requestUpdate() { + QMutexLocker locker(&mutex); + // enumerate interfaces WLAN_INTERFACE_INFO_LIST *interfaceList; DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList); @@ -440,6 +452,8 @@ void QNativeWifiEngine::requestUpdate() QNetworkSession::State QNativeWifiEngine::sessionStateForId(const QString &id) { + QMutexLocker locker(&mutex); + QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id); if (!ptr) |