Qt 6.8.3 with BlackBerry 10 (QNX 8 / ARMv7) patches
 
 
 
 
 
 
Go to file
Marc Mutz 039b2e4e5d QTzTimeZoneCache: don't hold mutex while parsing files
The QTzTimeZoneCache::findEntry() function is always called with
QTzTimeZoneCache::m_mutex held, from its only caller,
QTzTimeZoneCache::fetchEntry().

However, findEntry() performs quite heavy parsing, reading
e.g. /etc/localtime or a file in /usr/share/zoneinfo/. These files are
larger than 2KiB file on my system.

Even though findEntry() doesn't touch m_cache during its operation¹,
it thus prevents other threads from looking up (and even parsing)
other entries in the cache.

A straight-forward solution is therefore to drop the mutex in
fetchEntry() for the duration of the findEntry() call² and then
re-acquire it for the final m_cache.insert().

This means, of course, that more than one thread could parse the same
file concurrently, and then one of the thread's result would be
discarded. Having the file already in the OS cache makes this probably
less of an issue than it sounds, but more complicated protocols are
readily implementable, should it become necessary. QTBUG-122138 has a
sketch.

¹ It's a static function, so it cannot access NSDMs.
² Incl. the heap allocation required to store the result in QCache.

Fixes: QTBUG-122138
Pick-to: 6.7
Change-Id: If0cba6d041fb21a48cbde6b43190662a2c55cd25
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:20:50 +01:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
LICENSES Update QLocale and calendar data to CLDR v44.1 2024-02-02 08:26:03 +01:00
bin CMake: Don't strip debug builds with qt-cmake-private-install in CI 2023-11-03 18:24:46 +02:00
cmake Fix framework headers copying when module don't have header files 2024-02-15 14:04:44 +01:00
coin Fix mount command 2024-02-15 09:52:52 +02:00
config.tests Remove the mandatory x86-64 features from its feature list 2023-05-31 14:55:37 -07:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Change doc snippet license 2024-02-02 16:52:11 +00:00
examples Doc: Resolve qdoc link warnings 2024-02-14 21:47:28 +01:00
lib
libexec CMake: Add a config.redo script similar to qt5's config.status 2023-09-20 21:20:13 +02:00
mkspecs Bump iOS minimum deployment target to iOS 16 2024-02-14 04:17:16 +01:00
qmake Correct license in qmake/ 2024-02-13 13:55:02 +01:00
src QTzTimeZoneCache: don't hold mutex while parsing files 2024-02-16 14:20:50 +01:00
tests QTimer: use QTest::ingoreMessage() for negative internvals tests 2024-02-15 22:35:00 +02:00
util Minor tidy-up of CldrAccess.__enumMap: revise comment, modernize code 2024-02-13 15:58:43 +01:00
.cmake.conf Remove year from generic Qt copyright information 2024-02-14 09:30:07 +00:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Git ignore Visual Studio CMake build directories 2023-11-24 23:42:05 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt cmake: build repo helpers - fine-grained test/example options 2024-02-08 23:30:29 +08:00
config_help.txt Add configure mappings for QT_BUILD_<TESTS|EXAMPLES>_PROJECT 2024-02-14 20:47:29 +00:00
configure Change configure license 2024-02-02 15:23:02 +00:00
configure.bat Change license of configure.bat file 2024-02-07 12:15:09 +00:00
configure.cmake Remove year from generic Qt copyright information 2024-02-14 09:30:07 +00:00
dependencies.yaml
qt_cmdline.cmake Add coverage and coverage-gcov features 2023-09-22 15:54:30 +02:00