mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
FindThreads: Add pthread_cancel to program to test for pthreads in libc
When using ThreadSanitizer our existing CMAKE_HAVE_LIBC_PTHREAD test program links using symbols from the tsan library. Among the symbols not provided by that library, `pthread_cancel()` seems to be the less risky symbol to add to the check. Fixes: #19981
This commit is contained in:
committed by
Brad King
parent
25b7456f0e
commit
b328cbaadb
@@ -63,6 +63,7 @@ int main(void)
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, test_func, NULL);
|
||||
pthread_detach(thread);
|
||||
pthread_cancel(thread);
|
||||
pthread_join(thread, NULL);
|
||||
pthread_atfork(NULL, NULL, NULL);
|
||||
pthread_exit(NULL);
|
||||
|
||||
Reference in New Issue
Block a user