X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpthread.in.h;h=da7bd4eebfed4f062abe791349d6f6c7432ccc9e;hb=2aa729ac6af316bc30111144684a51c4650d5c44;hp=f8e358b84ace21e5f3eae4a33c1543d1f52d55e1;hpb=66cc02681886cc3da705d0efb7a30a54bc8ce6b4;p=gnulib.git diff --git a/lib/pthread.in.h b/lib/pthread.in.h index f8e358b84..da7bd4eeb 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -1,6 +1,6 @@ /* Implement a trivial subset of POSIX 1003.1-2008 pthread.h. - Copyright (C) 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2009-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ /* The include_next requires a split double-inclusion guard. */ #if @HAVE_PTHREAD_H@ @@ -39,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; @@ -51,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 @@ -96,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 @@ -216,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; @@ -253,6 +264,10 @@ 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_ */