Skip to content

Commit fa4dd58

Browse files
Shane KearnsPasi Pentikäinen
authored andcommitted
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 <[email protected]> (cherry picked from commit 8f02668) Reviewed-by: Pasi Pentikäinen <[email protected]>
1 parent cc57cd2 commit fa4dd58

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/network/bearer/qnetworkconfigmanager_p.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,17 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
391391
engine->moveToThread(bearerThread);
392392

393393
connect(engine, SIGNAL(updateCompleted()),
394-
this, SLOT(updateConfigurations()));
394+
this, SLOT(updateConfigurations()),
395+
Qt::QueuedConnection);
395396
connect(engine, SIGNAL(configurationAdded(QNetworkConfigurationPrivatePointer)),
396-
this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)));
397+
this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)),
398+
Qt::QueuedConnection);
397399
connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
398-
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
400+
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)),
401+
Qt::QueuedConnection);
399402
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
400-
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
403+
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)),
404+
Qt::QueuedConnection);
401405
}
402406
}
403407

0 commit comments

Comments
 (0)