>From e671c501e95e9372db2f61a86aa27c986895c943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Fri, 13 Jun 2014 19:56:20 +0100 Subject: [PATCH] pthread: define thread safe macros on some platforms * m4/pthread.m4 (gl_PTHREAD_CHECK): Define macros needed for thread safe access on some platforms. --- ChangeLog | 6 ++++++ m4/pthread.m4 | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd19897..27fc247 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-06-14 Pádraig Brady + + pthread: define thread safe macros on some platforms + * m4/pthread.m4 (gl_PTHREAD_CHECK): Define macros needed + for thread safe access on some platforms. + 2014-06-13 Paul Eggert regex: don't be multithreaded if USE_UNLOCKED_IO. diff --git a/m4/pthread.m4 b/m4/pthread.m4 index 1ed0dd3..cba1606 100644 --- a/m4/pthread.m4 +++ b/m4/pthread.m4 @@ -88,6 +88,20 @@ AC_DEFUN([gl_PTHREAD_CHECK], fi AC_SUBST([LIB_PTHREAD]) + dnl Some systems optimize for single-threaded programs by default, and + dnl need special flags to disable these optimizations. For example, the + dnl definition of 'errno' in . + case "$host_os" in + aix* | freebsd*) + AC_DEFINE([_THREAD_SAFE], 1, + [Define on some systems, to enable only thread safe operations.]) + ;; + osf* | solaris*) + AC_DEFINE([_REENTRANT], 1, + [Define on some systems, to enable only thread safe operations.]) + ;; + esac + AC_REQUIRE([AC_C_RESTRICT]) ]) -- 1.7.7.6