From 5dbe3ecde8864e7ce4cfd32b650b6684be693d69 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Jan 2025 11:07:34 -0800 Subject: [PATCH] QMutex: improve codegen for non-futex lockInternal() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends commit ff9da1db0b0963f967f45ab430ec40a3051b70b4. QDeadlineTimer's Forever constructor is constexpr inline, while the one taking an integer is neither. In an LTO build, the compiler might have realized that it's constant, but let's be sure. Pick-to: 6.8 Change-Id: I2c07caec660e05efe695fffd6ac8ec3120258a96 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit ef73a5f175f8d51a0bacbdd30cacbd3b6d151d36) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/thread/qmutex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 2dbfe2720c2..b6c68cc5c14 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -652,7 +652,7 @@ void QBasicMutex::lockInternal() noexcept(FutexAlwaysAvailable) } Q_ASSERT(d_ptr.loadRelaxed()); } else { - lockInternal(-1); + lockInternal(QDeadlineTimer::Forever); } }