summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Kearns <ext-shane.2.kearns@nokia.com>2012-04-27 11:31:58 +0100
committerPasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>2012-05-14 12:35:53 +0200
commitfa4dd583a5302e642400827b4529dfc29a425d9a (patch)
treec80174dd228ef8c626a9defe3fdd7d227fd068f9
parentcc57cd255a923140aed48a4b1211e99966ff8e0b (diff)
Connect bearer engines to manager with QueuedConnection
This is to avoid a deadlock that happens when a user thread is accessing the QNetworkConfigurationManager at the same time the plugin emits a signal. i.e. plugin is holding engine lock user thread is holding manager lock and blocked trying to acquire the engine lock In the manager slot, it tries to acquire the manager lock. By using queued connection, there are no locks held at the time the manager slot is called. Change-Id: I95f28028b5e77f77b2b9b7e31cbd1b78a8fe3097 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> (cherry picked from commit 8f026689d57fa282a7d71174d053e8f4c146e418) Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index a00596c1a7..de4445197e 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -391,13 +391,17 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
engine->moveToThread(bearerThread);
connect(engine, SIGNAL(updateCompleted()),
- this, SLOT(updateConfigurations()));
+ this, SLOT(updateConfigurations()),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationAdded(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
+ this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)),
+ Qt::QueuedConnection);
}
}