pthread: add to system <pthread.h> instead of replacing it all, for MacOS
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 22 Sep 2010 08:32:19 +0000 (01:32 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 22 Sep 2010 08:33:51 +0000 (01:33 -0700)
commit66cc02681886cc3da705d0efb7a30a54bc8ce6b4
treee492cb4a94a2723a071e9394be6d4701005eb9f3
parent3fdb706a2a7464a81025bfd07d06c867130f9f1f
pthread: add to system <pthread.h> instead of replacing it all, for MacOS

* lib/pthread.in.h: Add split double-inclusion guard, and include
system <pthread.h> if there is one.  Use @@-style as in other
.in.h files.  Define PTHREAD_COND_INITIALIZER etc. only if system
pthread.h doesn't.
(pthread_mutexattr_destroy, pthread_mutexattr_init):
(pthread_mutexattr_settype, pthread_mutex_trylock):
New static inline functions, if there's no system <pthread.h>.
(pthread_spinlock_t, pthread_spin_init, pthread_spin_destroy):
(pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock):
Approximate with mutexes if the system lacks spinlocks, as in
MacOS.
* m4/pthread.m4 (gl_PTHREAD_CHECK): Require gl_PTHREAD_DEFAULTS.
Add gl_CHECK_NEXT_HEADERS for pthread.h, and support the usual
@@-style.  Check for spinlocks separately.
(gl_PTHREAD_DEFAULTS): New macro.
* modules/pthread: Redo to use a more typical style for in.h files.
ChangeLog
lib/pthread.in.h
m4/pthread.m4
modules/pthread