summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/icd
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-22 01:23:24 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-22 01:42:03 (GMT)
commita56597916b275a2f0d2e3b9f8ac3653eeb4e2e91 (patch)
treeb1bfe41a9bd2b0569e1df9fcd662b95272c6156e /src/plugins/bearer/icd
parent0109df3ee449767c1836ec7028ac219c57cf9ca7 (diff)
downloadQt-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/icd')
-rw-r--r--src/plugins/bearer/icd/qicdengine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/bearer/icd/qicdengine.cpp b/src/plugins/bearer/icd/qicdengine.cpp
index 3233eda..f10042a 100644
--- a/src/plugins/bearer/icd/qicdengine.cpp
+++ b/src/plugins/bearer/icd/qicdengine.cpp
@@ -100,6 +100,8 @@ QIcdEngine::~QIcdEngine()
bool QIcdEngine::hasIdentifier(const QString &id)
{
+ QMutexLocker locker(&mutex);
+
return accessPointConfigurations.contains(id) ||
snapConfigurations.contains(id) ||
userChoiceConfigurations.contains(id);
@@ -107,6 +109,8 @@ bool QIcdEngine::hasIdentifier(const QString &id)
void QIcdEngine::requestUpdate()
{
+ QMutexLocker locker(&mutex);
+
QTimer::singleShot(0, this, SLOT(doRequestUpdate()));
}
@@ -156,6 +160,8 @@ static uint32_t getNetworkAttrs(bool is_iap_id,
void QIcdEngine::doRequestUpdate()
{
+ QMutexLocker locker(&mutex);
+
QStringList previous = accessPointConfigurations.keys();
/* All the scanned access points */
@@ -371,6 +377,8 @@ void QIcdEngine::doRequestUpdate()
void QIcdEngine::deleteConfiguration(const QString &iap_id)
{
+ QMutexLocker locker(&mutex);
+
/* Called when IAPs are deleted in gconf, in this case we do not scan
* or read all the IAPs from gconf because it might take too much power
* (multiple applications would need to scan and read all IAPs from gconf)
@@ -409,6 +417,8 @@ QNetworkSessionPrivate *QIcdEngine::createSessionBackend()
QNetworkConfigurationPrivatePointer QIcdEngine::defaultConfiguration()
{
+ QMutexLocker locker(&mutex);
+
// Here we just return [ANY] request to icd and let the icd decide which IAP to connect.
return userChoiceConfigurations.value(OSSO_IAP_ANY);
}