summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorShane Kearns <ext-shane.2.kearns@nokia.com>2012-04-27 11:31:58 +0100
committerQt by Nokia <qt-info@nokia.com>2012-05-09 02:28:16 +0200
commit55070e863710d49dd4b09903be9a85ea94dff1fe (patch)
tree9c6f880db881f720499b2a2f3dfa748701c37890 /src/network
parent9793dbcc4ae4f5f0976f819e6a33e82e6b24f50e (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>
Diffstat (limited to 'src/network')
-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 d152adca92..527e55008e 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -393,13 +393,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);
}
}