summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qeventdispatcher_glib.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-31 17:19:06 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-03-26 17:15:02 +0100
commit80b6bcc385863a38d499685af9b8e857e46cbdba (patch)
tree252b745a2b8dd617224f49cf89139cd5baef317c /src/corelib/kernel/qeventdispatcher_glib.cpp
parentedb64351cd0896d27af15d54d5fa868c7567eced (diff)
Short live Q_CONSTINIT!
It expands to the first available of - constinit (C++20) - [[clang::require_constant_initialization]] (Clang) - __constinit (GCC >= 10) Use it around the code (on and near static QBasicAtomic; this patch makes no attempt to find all statics in qtbase). [ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT. Fixes: QTBUG-100484 Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel/qeventdispatcher_glib.cpp')
-rw-r--r--src/corelib/kernel/qeventdispatcher_glib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_glib.cpp b/src/corelib/kernel/qeventdispatcher_glib.cpp
index 974ce7f5e1..cff3efd1cc 100644
--- a/src/corelib/kernel/qeventdispatcher_glib.cpp
+++ b/src/corelib/kernel/qeventdispatcher_glib.cpp
@@ -296,7 +296,7 @@ QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(GMainContext *context)
{
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 32
if (qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB")) {
- static QBasicMutex mutex;
+ Q_CONSTINIT static QBasicMutex mutex;
QMutexLocker locker(&mutex);
if (!g_thread_supported())
g_thread_init(NULL);