Subject: bug#7073: no pthread_spinlock_t on Mac OS 10.6.4

From: Bruno Haible <[email-masked]>
Date: Tue, 21 Sep 2010 12:43:48 +0200

Hi Paul,

> The problem is that the gnulib i18n code includes pthread.h for its
> own purposes 

I wouldn't call it "the gnulib i18n code". The modules 'lock', 'tls',
etc. are needed by the modules 'strsignal', 'fstrcmp', and 'localename'.
Basically, every piece of code that wants to provide multithreaded
access to a global variable (may it be a registry or cache or anything)
needs locking.

> and wants primitives that our trivial pthread replacement doesn't supply.

Sure, when gnulib provides a "replacement" of a system header, it should
not remove features from the system headers that other parties may rely
upon.

> +   AC_CHECK_TYPES([pthread_t, pthread_spinlock_t])

It would be wise to include <pthread.h> here. Not all systems define
these types in <sys/types.h>; some (e.g. mingw pthreads-win32) require
a #include <pthread.h>. This include is not part of AC_INCLUDES_DEFAULT.

Bruno