diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-08 13:04:13 +1000 |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-12 08:27:21 +1000 |
commit | cf69144f2b5511c6e4e81bd9da8ee6acd2340e5c (patch) | |
tree | 5df42e812b7c824486cc8ae7f333e99e5b5bd176 /src/network/bearer/qnetworkconfiguration_p.h | |
parent | 0b2190dad38cbe4c8245d500a0fc7cf6f69cc0da (diff) | |
download | qt4-tools-cf69144f2b5511c6e4e81bd9da8ee6acd2340e5c.tar.gz |
Make QNetworkConfigurationManager and QNetworkConfiguration threadsafe.
Diffstat (limited to 'src/network/bearer/qnetworkconfiguration_p.h')
-rw-r--r-- | src/network/bearer/qnetworkconfiguration_p.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h index 6b40946437..6908277c3e 100644 --- a/src/network/bearer/qnetworkconfiguration_p.h +++ b/src/network/bearer/qnetworkconfiguration_p.h @@ -54,7 +54,9 @@ // #include "qnetworkconfiguration.h" + #include <QtCore/qshareddata.h> +#include <QtCore/qmutex.h> #include <QtNetwork/QNetworkInterface> QT_BEGIN_NAMESPACE @@ -64,8 +66,9 @@ class QNetworkConfigurationPrivate : public QSharedData { public: QNetworkConfigurationPrivate () - : isValid(false), type(QNetworkConfiguration::Invalid), - roamingSupported(false), purpose(QNetworkConfiguration::UnknownPurpose), internet(false) + : mutex(QMutex::Recursive), type(QNetworkConfiguration::Invalid), + purpose(QNetworkConfiguration::UnknownPurpose), + isValid(false), roamingSupported(false) { } @@ -77,26 +80,27 @@ public: virtual QString bearerName() const { + QMutexLocker locker(&mutex); + return bearer; } - QString bearer; + mutable QMutex mutex; + QString bearer; QString name; - - bool isValid; QString id; + QNetworkConfiguration::StateFlags state; QNetworkConfiguration::Type type; - bool roamingSupported; QNetworkConfiguration::Purpose purpose; - bool internet; - QList<QNetworkConfigurationPrivatePointer> serviceNetworkMembers; -private: + bool isValid; + bool roamingSupported; +private: // disallow detaching QNetworkConfigurationPrivate &operator=(const QNetworkConfigurationPrivate &other); QNetworkConfigurationPrivate(const QNetworkConfigurationPrivate &other); |