summaryrefslogtreecommitdiffstats
path: root/src/network/bearer/qnetworkconfigmanager_p.h
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-06-01 16:35:43 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-25 11:47:22 +0100
commitf6b30722fa166fa1ed9ea0ad14bdb6e757317932 (patch)
tree881c9f0478de9cae4cb69ebb6642af8af0c748be /src/network/bearer/qnetworkconfigmanager_p.h
parente52ef6788b38f22ed024f1595392fd620e0773ef (diff)
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>
Diffstat (limited to 'src/network/bearer/qnetworkconfigmanager_p.h')
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h
index f96aedfffc..35b1f2b49c 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.h
+++ b/src/network/bearer/qnetworkconfigmanager_p.h
@@ -89,6 +89,8 @@ public:
void enablePolling();
void disablePolling();
+ void initialize();
+ void cleanup();
public Q_SLOTS:
void updateConfigurations();
@@ -112,6 +114,7 @@ private Q_SLOTS:
private:
Q_INVOKABLE void startPolling();
QTimer *pollTimer;
+ QThread *bearerThread;
private:
mutable QMutex mutex;