diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-02-16 15:03:01 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-02-16 19:26:46 +0000 |
commit | cad9c7cbc9339165bb71a54c3981ccd56b6d8ef8 (patch) | |
tree | a04365ff0f0969a8d5f43418daea01ae0e7381c0 /src/opengl/gl2paintengineex | |
parent | 99ce1d3d97c0423c3ee63ccf58deed964db0770e (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/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index c1c5661da4..d5ce4efd1a 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE static int next_qgltextureglyphcache_serial_number() { - static QBasicAtomicInt serial; + static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(0); return 1 + serial.fetchAndAddRelaxed(1); } |