bearer: run the bearer engines in their own worker thread
authorShane Kearns <shane.kearns@accenture.com>
Wed, 1 Jun 2011 15:35:43 +0000 (16:35 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 25 Jan 2012 10:47:22 +0000 (11:47 +0100)
commitf6b30722fa166fa1ed9ea0ad14bdb6e757317932
tree881c9f0478de9cae4cb69ebb6642af8af0c748be
parente52ef6788b38f22ed024f1595392fd620e0773ef
bearer: run the bearer engines in their own worker thread

The original architecture of the QtNetwork bearer support hosted the
engines in the application's main thread, but this causes some problems.
If the QNetworkConfigurationManager is constructed in a worker thread,
then it is populated asynchronously without any notification when it is
done (the app gets incomplete or missing results)
Fixing that by restoring the earlier behaviour of using blocking queued
connections to wait for the lists to be populated caused a regression,
as some applications deadlock because the main thread is waiting on the
worker thread at this time.

By introducing a dedicated worker thread for the bearer engines,
QNetworkConfigurationManager can be safely constructed in any thread
while using blocking queued connections internally.

Task-number: QTBUG-18795
Change-Id: Iaa1706d44b02b42057c100b0b399364175af2ddb
Reviewed-by: mread
(cherry picked from commit 5f879c55e531165cc2569b03c3796d0f33d0a0b7)
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Murray Read <ext-murray.2.read@nokia.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
src/network/bearer/qnetworkconfigmanager.cpp
src/network/bearer/qnetworkconfigmanager_p.cpp
src/network/bearer/qnetworkconfigmanager_p.h