qt6-bb10/tests/auto/corelib/thread/qthread
Thiago Macieira 1ed0dd88a3 QThread/Unix: make QThreadPrivate::finish() be called much later
We need it to run after all the thread-local destructors have run, to
ensure that some user code hasn't run after QThreadPrivate::finish() has
finished. We achieve that by making it get called from a thread-local
destructor itself, in the form of a qScopeGuard.

This ought to have been done since C++11 thread_local with non-trivial
destructors became available. However, it only started showing up after
commit 4a93285b16 began using thread_local
inside Qt itself. The visible symptom was that QThreadPrivate::finish()
had already destroyed the thread's event dispatcher, but some user code
ran later and expected it to still exist (or, worse, recreated it, via
QEventLoop → QThreadData::ensureEventDispatcher).

Fixes: QTBUG-117996
Pick-to: 6.7
Change-Id: I8f3ce163ccc5408cac39fffd178d682e5bfa6955
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-07 14:22:27 -07:00
..
.gitignore Moving relevant tests to corelib/thread 2011-09-01 12:54:58 +02:00
BLACKLIST Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
CMakeLists.txt CMake: Make corelib tests standalone projects 2023-07-05 15:09:32 +02:00
tst_qthread.cpp QThread/Unix: make QThreadPrivate::finish() be called much later 2024-05-07 14:22:27 -07:00