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>bb10
parent
9793dbcc4a
commit
55070e8637
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue