summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/kernel/qhostinfo_p.h')
-rw-r--r--src/network/kernel/qhostinfo_p.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h
index 7df3f5414c..0433d1d17b 100644
--- a/src/network/kernel/qhostinfo_p.h
+++ b/src/network/kernel/qhostinfo_p.h
@@ -73,6 +73,7 @@
#include <QNetworkSession>
#include <QSharedPointer>
+#include <atomic>
QT_BEGIN_NAMESPACE
@@ -177,10 +178,12 @@ public:
void put(const QString &name, const QHostInfo &info);
void clear();
- bool isEnabled();
- void setEnabled(bool e);
+ bool isEnabled() { return enabled.load(std::memory_order_relaxed); }
+ // this function is currently only used for the auto tests
+ // and not usable by public API
+ void setEnabled(bool e) { enabled.store(e, std::memory_order_relaxed); }
private:
- bool enabled;
+ std::atomic<bool> enabled;
struct QHostInfoCacheElement {
QHostInfo info;
QElapsedTimer age;