X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Fpthread.in.h;h=c05c7c9f5969857594c962d6fc8ce65956e8c2ae;hb=1287b65e0b788f3cd9dc02b3d4edaaef0983f92e;hp=a3669a5f3a4181070636cb40a86ee9dca498e126;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/pthread.in.h b/lib/pthread.in.h index a3669a5f3..c05c7c9f5 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -18,7 +18,7 @@ /* Written by Paul Eggert and Glen Lenker. */ -#ifndef _GL_PTHREAD_H_ +#ifndef _@GUARD_PREFIX@_PTHREAD_H_ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -30,8 +30,8 @@ # @INCLUDE_NEXT@ @NEXT_PTHREAD_H@ #endif -#ifndef _GL_PTHREAD_H_ -#define _GL_PTHREAD_H_ +#ifndef _@GUARD_PREFIX@_PTHREAD_H_ +#define _@GUARD_PREFIX@_PTHREAD_H_ #include #include @@ -40,6 +40,7 @@ #include #if ! @HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_types typedef int pthread_t; typedef int pthread_attr_t; typedef int pthread_barrier_t; @@ -52,6 +53,8 @@ typedef int pthread_once_t; typedef int pthread_rwlock_t; typedef int pthread_rwlockattr_t; +# define GNULIB_defined_pthread_types 1 +# endif #endif #ifndef PTHREAD_COND_INITIALIZER @@ -97,6 +100,8 @@ #if ! @HAVE_PTHREAD_T@ +# if !GNULIB_defined_pthread_functions + /* Provide substitutes for the thread functions that should work adequately on a single-threaded implementation, where pthread_create always fails. The goal is to let programs compile @@ -217,10 +222,15 @@ pthread_mutex_unlock (pthread_mutex_t *mutex) return 0; } +# define GNULIB_defined_pthread_functions 1 +# endif + #endif #if ! @HAVE_PTHREAD_SPINLOCK_T@ +# if !GNULIB_defined_pthread_spinlock_t + /* Approximate spinlocks with mutexes. */ typedef pthread_mutex_t pthread_spinlock_t; @@ -254,7 +264,11 @@ pthread_spin_unlock (pthread_spinlock_t *lock) { return pthread_mutex_unlock (lock); } + +# define GNULIB_defined_pthread_spinlock_t 1 +# endif + #endif -#endif /* _GL_PTHREAD_H_ */ -#endif /* _GL_PTHREAD_H_ */ +#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ +#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */