QThread: disable pthread_clockjoin_np when building under TSAN

TSAN does not support intercepting pthread_clockjoin_np (only join,
tryjoin and timedjoin), and will claim that an application leaks threads.
Disable the clockjoin codepath when building under TSAN.

Unfortunately I can't seem to find a version check for the sanitizers to
apply here and know if and when TSAN will get this support.

Pick-to: 6.9
Change-Id: If12419e5d600e519bf4315d27f74d74a87dcf792
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2025-02-28 19:11:36 +01:00
parent 03efe9a21b
commit 84d6309cf1

View File

@ -454,11 +454,18 @@ poll(&pfd, 1, 0);
")
# pthread_clockjoin
# As of GCC 15, TSAN does not support pthread_clockjoin_np,
# so disable it in a TSAN build. Unfortunately there doesn't
# seem to be a version check possible, just check the
# TSAN_INTERCEPT macros into tsan_interceptors_posix.cpp.
qt_config_compile_test(pthread_clockjoin
LABEL "pthread_clockjoin()"
LIBRARIES Threads::Threads
CODE
"#include <pthread.h>
#if __has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__)
#error
#endif
int main()
{
void *ret;