summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-02-16 15:03:01 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-02-16 19:26:46 +0000
commitcad9c7cbc9339165bb71a54c3981ccd56b6d8ef8 (patch)
treea04365ff0f0969a8d5f43418daea01ae0e7381c0 /src/network/kernel/qhostinfo.cpp
parent99ce1d3d97c0423c3ee63ccf58deed964db0770e (diff)
Use static initialization for QBasicAtomics
A default-constructed static QBasicAtomicInt at function scope will be dynamically initialized. It will still be zero-initialized, but at least GCC adds guard variables for such objects. When using aggregate initialization, the guard disappears. Amends 04d6495bf773a6bb0d4fa6980df22d3b81a605b0. Change-Id: Id9335cffdd43094cafb231fdde2523d013abe1d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/kernel/qhostinfo.cpp')
-rw-r--r--src/network/kernel/qhostinfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index d3a1858f86..46123eb8a7 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -185,7 +185,7 @@ void emit_results_ready(const QHostInfo &hostInfo, const QObject *receiver,
static int nextId()
{
- static QBasicAtomicInt counter;
+ static QBasicAtomicInt counter = Q_BASIC_ATOMIC_INITIALIZER(0);
return 1 + counter.fetchAndAddRelaxed(1);
}