lock: work around pthread recursive mutexes bug in Mac OS X 10.6
authorDaiki Ueno <ueno@gnu.org>
Sat, 11 May 2013 01:40:55 +0000 (10:40 +0900)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 12 May 2013 03:04:31 +0000 (20:04 -0700)
* m4/lock.m4: Don't define HAVE_PTHREAD_MUTEX_RECURSIVE if the
compilation target is Mac OS X 10.6.
Problem reported by parafin and Andoni Morales in
<http://savannah.gnu.org/bugs/?37844> and
<http://lists.gnu.org/archive/html/bug-gettext/2013-05/msg00007.html>.

ChangeLog
m4/lock.m4

index 0a2b457..94cc0d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2013-05-11  Daiki Ueno  <ueno@gnu.org>
+
+       lock: work around pthread recursive mutexes bug in Mac OS X 10.6
+       * m4/lock.m4: Don't define HAVE_PTHREAD_MUTEX_RECURSIVE if the
+       compilation target is Mac OS X 10.6.
+       Problem reported by parafin and Andoni Morales in
+       <http://savannah.gnu.org/bugs/?37844> and
+       <http://lists.gnu.org/archive/html/bug-gettext/2013-05/msg00007.html>.
+
 2013-05-11  Paul Eggert  <eggert@cs.ucla.edu>
 
        mkdir-p: remove assumptions about umask and mode
index d3fc1ef..aae1701 100644 (file)
@@ -24,6 +24,9 @@ AC_DEFUN([gl_LOCK],
         [[
 #if __FreeBSD__ == 4
 error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
 #else
 int x = (int)PTHREAD_MUTEX_RECURSIVE;
 return !x;