qt5base-lts/tests/auto/corelib/thread
Ievgenii Meshcheriakov 52ad59f9ea QThread: Reset the system thread ID when thread exits on Unix
Unix QThread implementation stores pthread_t as a system thread ID
when the thread is created, but never resets the system ID when
those threads are destroyed. Some implementations may reuse the
same thread IDs for new threads, and this may cause QThread::wait()
to erroneously complain that "Thread tried to wait on itself".

This patch sets the system thread ID to nullptr when the thread is
about to exit and be destroyed by the system.

A regression test is added to tst_qthread.

Fixes: QTBUG-96846
Pick-to: 5.15 6.2
Change-Id: I0850425dd0e09af50e59c9038e7e662a2a624beb
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-29 01:53:49 +02:00
..
qatomicint Remove the qmake project files 2021-01-07 15:32:28 +01:00
qatomicinteger Remove the qmake project files 2021-01-07 15:32:28 +01:00
qatomicpointer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfuture Don't report results when the results list is empty 2021-07-27 19:57:27 +02:00
qfuturesynchronizer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfuturewatcher QtConcurrent::run: support non default-constructible return types 2021-08-18 09:41:55 +02:00
qmutex tests: fix some -Wvolatile 2021-07-28 17:50:09 +02:00
qmutexlocker Remove the qmake project files 2021-01-07 15:32:28 +01:00
qpromise QFuture/QPromise: don't check for is_copy_constructible 2021-05-21 11:08:11 +02:00
qreadlocker Remove the qmake project files 2021-01-07 15:32:28 +01:00
qreadwritelock Skip tst_QReadWriteLock::multipleReadersLoop on QEMU 2021-09-09 21:08:42 +02:00
qresultstore Don't report results when the results list is empty 2021-07-27 19:57:27 +02:00
qsemaphore QSemaphore: add <chrono> overload of tryAcquire() 2021-06-30 23:48:21 +02:00
qthread QThread: Reset the system thread ID when thread exits on Unix 2021-09-29 01:53:49 +02:00
qthreadonce Skip tst_qthreadonce test on QEMU 2021-07-20 16:51:51 +02:00
qthreadpool QThreadPool: Fix restarting of expired threads 2021-09-15 15:46:53 +02:00
qthreadstorage Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qwaitcondition Remove the qmake project files 2021-01-07 15:32:28 +01:00
qwritelocker Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Compile autotests for Integrity 2021-09-20 17:29:04 +03:00