summaryrefslogtreecommitdiff
path: root/src/mpfr-thread.h
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-18 23:59:09 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-18 23:59:09 +0000
commit6f2acc2f8759019e3944bb7e3e5ddd00a8757aa9 (patch)
tree4d24a83a80c805e1fb88d5690fede3f4dede1402 /src/mpfr-thread.h
parentd6252e7c3047c8986eec060049203df1d6512477 (diff)
downloadmpfr-6f2acc2f8759019e3944bb7e3e5ddd00a8757aa9.tar.gz
Shared caches: fix and minor changes.
* Fixed detection and use of C11 thread support: the C11 header is <threads.h>, not <thread.h>. * Renamed WANT_SHARED_CACHE to MPFR_WANT_SHARED_CACHE for consistency with the other MPFR_WANT_* macros. * Added MPFR_THREAD_LOCK_METHOD macro, giving the thread locking method as a string (when shared caches are enabled). * doc/README.dev: documented 4 macros for shared caches. * tests/tversion.c: output MPFR_WANT_SHARED_CACHE and MPFR_THREAD_LOCK_METHOD information. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12937 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/mpfr-thread.h')
-rw-r--r--src/mpfr-thread.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mpfr-thread.h b/src/mpfr-thread.h
index 2bc1d525c..d8ca6e4b5 100644
--- a/src/mpfr-thread.h
+++ b/src/mpfr-thread.h
@@ -53,9 +53,13 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* ISO C11 version */
/**************************************************************************/
/**************************************************************************/
+
#if defined (MPFR_HAVE_C11_LOCK)
/* NOTE: This version has not been completely tested */
-#include <thread.h>
+
+#define MPFR_THREAD_LOCK_METHOD "C11"
+
+#include <threads.h>
#define MPFR_LOCK_DECL(_lock) \
mtx_t _lock;
@@ -110,8 +114,12 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* POSIX version */
/**************************************************************************/
/**************************************************************************/
+
#elif defined (HAVE_PTHREAD)
-# include <pthread.h>
+
+#define MPFR_THREAD_LOCK_METHOD "pthread"
+
+#include <pthread.h>
#define MPFR_LOCK_DECL(_lock) \
pthread_rwlock_t _lock;