diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-04-27 10:31:58 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-09 17:11:20 (GMT) |
commit | 8f026689d57fa282a7d71174d053e8f4c146e418 (patch) | |
tree | 6f1c5e8d3d834bc2d4b8f988ccc19ac60f365f69 /src/network | |
parent | 85f025245c42864d5a2f67fb72992a166a993829 (diff) | |
download | Qt-8f026689d57fa282a7d71174d053e8f4c146e418.zip Qt-8f026689d57fa282a7d71174d053e8f4c146e418.tar.gz Qt-8f026689d57fa282a7d71174d053e8f4c146e418.tar.bz2 |
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 55070e863710d49dd4b09903be9a85ea94dff1fe)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index a00596c..de44451 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); } } |