From: maier Date: Tue, 11 Sep 2012 10:38:45 +0000 (+0000) Subject: MT_POSIX_NO_BARRIERS added X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=658f49c488186f73538735b9cdffbb1c24d9da85;p=dealii-svn.git MT_POSIX_NO_BARRIERS added git-svn-id: https://svn.dealii.org/branches/branch_cmake@26278 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/cmake/modules/configure_threads.cmake b/deal.II/contrib/cmake/modules/configure_threads.cmake index 1ae8d120d7..8787435f61 100644 --- a/deal.II/contrib/cmake/modules/configure_threads.cmake +++ b/deal.II/contrib/cmake/modules/configure_threads.cmake @@ -44,5 +44,23 @@ IF(CMAKE_USE_PTHREADS_INIT) # Check whether posix thread barriers are available: + CHECK_CXX_SOURCE_COMPILES( + " + #include + int main() + { + pthread_barrier_t pb; + pthread_barrier_init (&pb, 0, 1); + pthread_barrier_wait (&pb); + pthread_barrier_destroy (&pb); + return 0; + } + " + DEAL_II_HAVE_MT_POSIX_BARRIERS) + + IF(NOT DEAL_II_HAVE_MT_POSIX_BARRIERS) + SET(DEAL_II_USE_MT_POSIX_NO_BARRIERS TRUE) + ENDIF() + ENDIF() diff --git a/deal.II/include/deal.II/base/config.h.in b/deal.II/include/deal.II/base/config.h.in index 64c2d04ebc..8fb78dc57e 100644 --- a/deal.II/include/deal.II/base/config.h.in +++ b/deal.II/include/deal.II/base/config.h.in @@ -81,7 +81,7 @@ * Barriers will then not work in the library, but the other threading * functionality is available. */ -#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS +#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS 1 /** * Depending on the use of threads, we will have to make some variables diff --git a/deal.II/include/deal.II/base/config.h.in.old b/deal.II/include/deal.II/base/config.h.in.old index 1bf12fc3f2..6f978e438d 100644 --- a/deal.II/include/deal.II/base/config.h.in.old +++ b/deal.II/include/deal.II/base/config.h.in.old @@ -193,11 +193,6 @@ /* Defined if a Metis installation was found and is going to be used */ #cmakedefine DEAL_II_USE_METIS -/* Defined if POSIX is supported but not the newer POSIX barrier functions. - Barriers will then not work in the library, but the other threading - functionality is available. */ -#cmakedefine DEAL_II_USE_MT_POSIX_NO_BARRIERS - /* Defined if a MUMPS installation was found and is going to be used */ #cmakedefine DEAL_II_USE_MUMPS