diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index d55a0f9585..7815c32d3c 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -401,6 +401,27 @@ if(UNIX) endif(UNIX) if(CMAKE_USE_PTHREADS_INIT) + wx_check_funcs( + pthread_attr_setstacksize + pthread_cancel + pthread_mutex_timedlock + pthread_setconcurrency + sched_yield + ) + + wx_check_funcs(pthread_attr_getschedpolicy) + if(HAVE_PTHREAD_ATTR_GETSCHEDPOLICY) + wx_check_funcs(pthread_attr_setschedparam) + if(HAVE_PTHREAD_ATTR_SETSCHEDPARAM) + wx_check_funcs(sched_get_priority_max) + if(HAVE_SCHED_GET_PRIORITY_MAX) + set(HAVE_THREAD_PRIORITY_FUNCTIONS 1) + else() + message(WARNING "Setting thread priority will not work") + endif() + endif() + endif() + cmake_push_check_state(RESET) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) wx_check_cxx_source_compiles(" diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index cc5132c406..ac4b4a488a 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -1026,7 +1026,7 @@ #cmakedefine HAVE_THR_SETCONCURRENCY 1 /* Define if you have pthread_setconcurrency function */ -#cmakedefine HAVE_PTHREAD_SET_CONCURRENCY 1 +#cmakedefine HAVE_PTHREAD_SETCONCURRENCY 1 /* Define if you have the uname function. */ #cmakedefine HAVE_UNAME 1