CMake: check for timed pthreads functions
The macros HAVE_PTHREAD_MUTEX_TIMEDLOCK HAVE_PTHREAD_COND_TIMEDWAIT are still being used in the Pthreads threading implementation, but the CMake build system never sets them, so the timed versions aren't used. This ended up making WorkerThread heartbeats not beat. </3
This commit is contained in:
@@ -231,6 +231,9 @@ find_package(Iconv)
|
||||
find_package(Threads)
|
||||
if (${Threads_FOUND})
|
||||
set(HAS_PTHREAD TRUE)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES pthread)
|
||||
check_symbol_exists(pthread_mutex_timedlock pthread.h HAVE_PTHREAD_MUTEX_TIMEDLOCK)
|
||||
check_symbol_exists(pthread_cond_timedwait pthread.h HAVE_PTHREAD_COND_TIMEDWAIT)
|
||||
else()
|
||||
set(HAS_PTHREAD FALSE)
|
||||
endif()
|
||||
|
||||
@@ -93,6 +93,12 @@
|
||||
/* Defined to 1 if the underlying system provides the posix_fadvise function. */
|
||||
#cmakedefine HAVE_POSIX_FADVISE 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the pthread_mutex_timedlock function. */
|
||||
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK 1
|
||||
|
||||
/* Defined to 1 if the underlying system provides the pthread_cond_timedwait function. */
|
||||
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDWAIT 1
|
||||
|
||||
/* Provide a fallback if intptr_t is not defined. */
|
||||
#cmakedefine HAVE_SIZEOF_INTPTR_T 1
|
||||
#if !defined(HAVE_SIZEOF_INTPTR_T)
|
||||
|
||||
Reference in New Issue
Block a user