1
#define if we have pthreads with recusrive capabilities
3
MACRO ( CHECK_PTHREAD_RECURSIVE ifpthread result)
6
SET ( CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
8
CHECK_CXX_SOURCE_RUNS("
14
pthread_mutexattr_t attr;
17
exit (pthread_mutexattr_init(&attr)
18
|| pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)
19
|| pthread_mutex_init(&m, &attr));
22
#NOTE: pthread_mutexattr_setkind_np is the deprecated name for pthread_mutexattr_settype. old compilers might need it
25
SET ( CMAKE_REQUIRED_FLAGS)
26
ENDIF ( ${ifpthread} )
27
ENDMACRO ( CHECK_PTHREAD_RECURSIVE )