From: Bruno Haible Date: Mon, 15 Jul 2019 00:36:24 +0000 (+0200) Subject: pthread-h: Add declarations of essential pthread functions. X-Git-Tag: v1.0~4753 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=79e228295ece60c7ba44fc68d313893270d503ca;p=gnulib.git pthread-h: Add declarations of essential pthread functions. * lib/pthread.in.h: Include snippets. (pthread_create, pthread_attr_init, pthread_attr_getdetachstate, pthread_attr_setdetachstate, pthread_attr_destroy, pthread_self, pthread_equal, pthread_detach, pthread_join, pthread_exit, pthread_once, pthread_mutex_init, pthread_mutexattr_init, pthread_mutexattr_gettype, pthread_mutexattr_settype, pthread_mutexattr_getrobust, pthread_mutexattr_setrobust, pthread_mutexattr_destroy, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, pthread_mutex_destroy, pthread_rwlock_init, pthread_rwlockattr_init, pthread_rwlockattr_destroy, pthread_rwlock_rdlock, pthread_rwlock_wrlock, pthread_rwlock_tryrdlock, pthread_rwlock_trywrlock, pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock, pthread_rwlock_unlock, pthread_rwlock_destroy, pthread_cond_init, pthread_condattr_init, pthread_condattr_destroy, pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy, pthread_key_create, pthread_setspecific, pthread_getspecific, pthread_key_delete, pthread_spin_init, pthread_spin_lock, pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): New declarations. (pthread_mutex_timedlock): Move declaration. * m4/pthread_h.m4 (gl_PTHREAD_H): Check whether the new functions are declared. (gl_PTHREAD_H_DEFAULTS): Initialize GNULIB_PTHREAD_THREAD, GNULIB_PTHREAD_ONCE, GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, GNULIB_PTHREAD_COND, GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the HAVE_* and REPLACE_* variables for the new functions. * modules/pthread-h (Depends-on): Add snippet/c++defs, snippet/_Noreturn, snippet/arg-nonnull, snippet/warn-on-use. (Makefile.am): Substitute GNULIB_PTHREAD_THREAD, GNULIB_PTHREAD_ONCE, GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, GNULIB_PTHREAD_COND, GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the HAVE_* and REPLACE_* variables for the new functions. Split the sed script, to avoid the limit of 99 commands of HP-UX sed. * tests/test-pthread-c++.cc: Check the signature of the new functions. --- diff --git a/ChangeLog b/ChangeLog index 20af670e63..3bb14c6ac0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +2019-07-14 Bruno Haible + + pthread-h: Add declarations of essential pthread functions. + * lib/pthread.in.h: Include snippets. + (pthread_create, pthread_attr_init, pthread_attr_getdetachstate, + pthread_attr_setdetachstate, pthread_attr_destroy, pthread_self, + pthread_equal, pthread_detach, pthread_join, pthread_exit, pthread_once, + pthread_mutex_init, pthread_mutexattr_init, pthread_mutexattr_gettype, + pthread_mutexattr_settype, pthread_mutexattr_getrobust, + pthread_mutexattr_setrobust, pthread_mutexattr_destroy, + pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, + pthread_mutex_destroy, pthread_rwlock_init, pthread_rwlockattr_init, + pthread_rwlockattr_destroy, pthread_rwlock_rdlock, + pthread_rwlock_wrlock, pthread_rwlock_tryrdlock, + pthread_rwlock_trywrlock, pthread_rwlock_timedrdlock, + pthread_rwlock_timedwrlock, pthread_rwlock_unlock, + pthread_rwlock_destroy, pthread_cond_init, pthread_condattr_init, + pthread_condattr_destroy, pthread_cond_wait, pthread_cond_timedwait, + pthread_cond_signal, pthread_cond_broadcast, pthread_cond_destroy, + pthread_key_create, pthread_setspecific, pthread_getspecific, + pthread_key_delete, pthread_spin_init, pthread_spin_lock, + pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy): New + declarations. + (pthread_mutex_timedlock): Move declaration. + * m4/pthread_h.m4 (gl_PTHREAD_H): Check whether the new functions are + declared. + (gl_PTHREAD_H_DEFAULTS): Initialize GNULIB_PTHREAD_THREAD, + GNULIB_PTHREAD_ONCE, GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, + GNULIB_PTHREAD_COND, GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the + HAVE_* and REPLACE_* variables for the new functions. + * modules/pthread-h (Depends-on): Add snippet/c++defs, + snippet/_Noreturn, snippet/arg-nonnull, snippet/warn-on-use. + (Makefile.am): Substitute GNULIB_PTHREAD_THREAD, GNULIB_PTHREAD_ONCE, + GNULIB_PTHREAD_MUTEX, GNULIB_PTHREAD_RWLOCK, GNULIB_PTHREAD_COND, + GNULIB_PTHREAD_TSS, GNULIB_PTHREAD_SPIN and the HAVE_* and REPLACE_* + variables for the new functions. Split the sed script, to avoid the + limit of 99 commands of HP-UX sed. + * tests/test-pthread-c++.cc: Check the signature of the new functions. + 2019-07-14 Bruno Haible pthread-h: Respect --enable-threads={posix|windows} option on mingw. diff --git a/lib/pthread.in.h b/lib/pthread.in.h index 1801dbe2f5..40fc48a60c 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -1,4 +1,4 @@ -/* Implement a trivial subset of POSIX 1003.1-2008 pthread.h. +/* Implement the most essential subset of POSIX 1003.1-2008 pthread.h. Copyright (C) 2009-2019 Free Software Foundation, Inc. @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . */ -/* Written by Paul Eggert and Glen Lenker. */ +/* Written by Paul Eggert, Glen Lenker, and Bruno Haible. */ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -69,6 +69,14 @@ #include #include +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _Noreturn is copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + #ifndef _GL_INLINE_HEADER_BEGIN #error "Please include config.h first." #endif @@ -275,24 +283,6 @@ pthread_mutex_unlock (pthread_mutex_t *mutex) # endif -#else - -# if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ -# if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@ -_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int, - (pthread_mutex_t *, const struct timespec *)); -# endif -_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, - (pthread_mutex_t *, const struct timespec *)); -_GL_CXXALIASWARN (pthread_mutex_timedlock); -# elif defined GNULIB_POSIXCHECK -# undef pthread_mutex_timedlock -# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK -_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is unportable - " - "use gnulib module pthread_mutex_timedlock for portability"); -# endif -# endif - #endif #if ! @HAVE_PTHREAD_SPINLOCK_T@ @@ -342,6 +332,1364 @@ pthread_spin_unlock (pthread_spinlock_t *lock) #endif +/* =========== Thread functions =========== */ + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_CREATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_create +# define pthread_create rpl_pthread_create +# endif +_GL_FUNCDECL_RPL (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg)); +# else +# if !@HAVE_PTHREAD_CREATE@ +_GL_FUNCDECL_SYS (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg) + _GL_ARG_NONNULL ((1, 3))); +# endif +_GL_CXXALIAS_SYS (pthread_create, int, + (pthread_t *threadp, const pthread_attr_t *attr, + void * (*mainfunc) (void *), void *arg)); +# endif +_GL_CXXALIASWARN (pthread_create); +#elif defined GNULIB_POSIXCHECK +# undef pthread_create +# if HAVE_RAW_DECL_PTHREAD_CREATE +_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_init +# define pthread_attr_init rpl_pthread_attr_init +# endif +_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr)); +# else +# if !@HAVE_PTHREAD_ATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_attr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_init +# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT +_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_getdetachstate +# define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate +# endif +_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int, + (pthread_attr_t *attr, int *detachstatep) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int, + (pthread_attr_t *attr, int *detachstatep)); +# else +# if !@HAVE_PTHREAD_ATTR_GETDETACHSTATE@ +_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int, + (pthread_attr_t *attr, int *detachstatep) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int, + (pthread_attr_t *attr, int *detachstatep)); +# endif +_GL_CXXALIASWARN (pthread_attr_getdetachstate); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_getdetachstate +# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE +_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_setdetachstate +# define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate +# endif +_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate)); +# else +# if !@HAVE_PTHREAD_ATTR_SETDETACHSTATE@ +_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int, + (pthread_attr_t *attr, int detachstate)); +# endif +_GL_CXXALIASWARN (pthread_attr_setdetachstate); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_setdetachstate +# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE +_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_ATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_attr_destroy +# define pthread_attr_destroy rpl_pthread_attr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr)); +# else +# if !@HAVE_PTHREAD_ATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_attr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_attr_destroy +# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY +_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_SELF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_self +# define pthread_self rpl_pthread_self +# endif +_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE); +_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void)); +# else +# if !@HAVE_PTHREAD_SELF@ +_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE); +# endif +_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void)); +# endif +_GL_CXXALIASWARN (pthread_self); +#elif defined GNULIB_POSIXCHECK +# undef pthread_self +# if HAVE_RAW_DECL_PTHREAD_SELF +_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_EQUAL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_equal +# define pthread_equal rpl_pthread_equal +# endif +_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# else +# if !@HAVE_PTHREAD_EQUAL@ +_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# endif +_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2)); +# endif +_GL_CXXALIASWARN (pthread_equal); +#elif defined GNULIB_POSIXCHECK +# undef pthread_equal +# if HAVE_RAW_DECL_PTHREAD_EQUAL +_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_DETACH@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_detach +# define pthread_detach rpl_pthread_detach +# endif +_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread)); +_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread)); +# else +# if !@HAVE_PTHREAD_DETACH@ +_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread)); +# endif +_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread)); +# endif +_GL_CXXALIASWARN (pthread_detach); +#elif defined GNULIB_POSIXCHECK +# undef pthread_detach +# if HAVE_RAW_DECL_PTHREAD_DETACH +_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_JOIN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_join +# define pthread_join rpl_pthread_join +# endif +_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep)); +_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep)); +# else +# if !@HAVE_PTHREAD_JOIN@ +_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep)); +# endif +_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep)); +# endif +_GL_CXXALIASWARN (pthread_join); +#elif defined GNULIB_POSIXCHECK +# undef pthread_join +# if HAVE_RAW_DECL_PTHREAD_JOIN +_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_THREAD@ +# if @REPLACE_PTHREAD_EXIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_exit +# define pthread_exit rpl_pthread_exit +# endif +_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value)); +_GL_CXXALIAS_RPL (pthread_exit, _Noreturn void, (void *value)); +# else +# if !@HAVE_PTHREAD_EXIT@ +_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value)); +# endif +_GL_CXXALIAS_SYS (pthread_exit, _Noreturn void, (void *value)); +# endif +_GL_CXXALIASWARN (pthread_exit); +#elif defined GNULIB_POSIXCHECK +# undef pthread_exit +# if HAVE_RAW_DECL_PTHREAD_EXIT +_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - " + "use gnulib module pthread-thread for portability"); +# endif +#endif + +/* =========== Once-only control (initialization) functions =========== */ + +#if @GNULIB_PTHREAD_ONCE@ +# if @REPLACE_PTHREAD_ONCE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_once +# define pthread_once rpl_pthread_once +# endif +_GL_FUNCDECL_RPL (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void)) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void))); +# else +# if !@HAVE_PTHREAD_ONCE@ +_GL_FUNCDECL_SYS (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void)) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_once, int, + (pthread_once_t *once_control, void (*initfunction) (void))); +# endif +_GL_CXXALIASWARN (pthread_once); +#elif defined GNULIB_POSIXCHECK +# undef pthread_once +# if HAVE_RAW_DECL_PTHREAD_ONCE +_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - " + "use gnulib module pthread-once for portability"); +# endif +#endif + +/* =========== Mutex functions =========== */ + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_init +# define pthread_mutex_init rpl_pthread_mutex_init +# endif +_GL_FUNCDECL_RPL (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEX_INIT@ +_GL_FUNCDECL_SYS (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_init, int, + (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutex_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_init +# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT +_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_init +# define pthread_mutexattr_init rpl_pthread_mutexattr_init +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_init +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT +_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_gettype +# define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_GETTYPE@ +_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *attr, int *typep)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_gettype); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_gettype +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE +_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_settype +# define pthread_mutexattr_settype rpl_pthread_mutexattr_settype +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_SETTYPE@ +_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int, + (pthread_mutexattr_t *attr, int type)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_settype); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_settype +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE +_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_getrobust +# define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_GETROBUST@ +_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *attr, int *robustp)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_getrobust); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_getrobust +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST +_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_setrobust +# define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_SETROBUST@ +_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *attr, int robust)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_setrobust); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_setrobust +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST +_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEXATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutexattr_destroy +# define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); +# else +# if !@HAVE_PTHREAD_MUTEXATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_mutexattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutexattr_destroy +# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY +_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_LOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_lock +# define pthread_mutex_lock rpl_pthread_mutex_lock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_LOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_lock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_lock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK +_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_TRYLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_trylock +# define pthread_mutex_trylock rpl_pthread_mutex_trylock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_TRYLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_trylock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_trylock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK +_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@ +# if @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_timedlock +# define pthread_mutex_timedlock rpl_pthread_mutex_timedlock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int, + (pthread_mutex_t *mutex, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_mutex_timedlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_timedlock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK +_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - " + "use gnulib module pthread_mutex_timedlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_unlock +# define pthread_mutex_unlock rpl_pthread_mutex_unlock +# endif +_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_unlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_unlock +# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK +_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_MUTEX@ +# if @REPLACE_PTHREAD_MUTEX_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_mutex_destroy +# define pthread_mutex_destroy rpl_pthread_mutex_destroy +# endif +_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_MUTEX_DESTROY@ +_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_mutex_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_mutex_destroy +# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY +_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - " + "use gnulib module pthread-mutex for portability"); +# endif +#endif + +/* =========== Read-write lock functions =========== */ + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_init +# define pthread_rwlock_init rpl_pthread_rwlock_init +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCK_INIT@ +_GL_FUNCDECL_SYS (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_init, int, + (pthread_rwlock_t *lock, const pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_init +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT +_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCKATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlockattr_init +# define pthread_rwlockattr_init rpl_pthread_rwlockattr_init +# endif +_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCKATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlockattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlockattr_init +# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT +_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlockattr_destroy +# define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr)); +# else +# if !@HAVE_PTHREAD_RWLOCKATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_rwlockattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlockattr_destroy +# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY +_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_RDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_rdlock +# define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_RDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_rdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_rdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK +_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_WRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_wrlock +# define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_WRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_wrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_wrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK +_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_tryrdlock +# define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TRYRDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_tryrdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_tryrdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK +_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_trywrlock +# define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TRYWRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_trywrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_trywrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK +_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_timedrdlock +# define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_timedrdlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_timedrdlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK +_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_timedwrlock +# define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *lock, const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_timedwrlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_timedwrlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK +_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_unlock +# define pthread_rwlock_unlock rpl_pthread_rwlock_unlock +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_unlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_unlock +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK +_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_RWLOCK@ +# if @REPLACE_PTHREAD_RWLOCK_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_rwlock_destroy +# define pthread_rwlock_destroy rpl_pthread_rwlock_destroy +# endif +_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); +# else +# if !@HAVE_PTHREAD_RWLOCK_DESTROY@ +_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_rwlock_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_rwlock_destroy +# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY +_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - " + "use gnulib module pthread-rwlock for portability"); +# endif +#endif + +/* =========== Condition variable functions =========== */ + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_init +# define pthread_cond_init rpl_pthread_cond_init +# endif +_GL_FUNCDECL_RPL (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_COND_INIT@ +_GL_FUNCDECL_SYS (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_init, int, + (pthread_cond_t *cond, const pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_cond_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_init +# if HAVE_RAW_DECL_PTHREAD_COND_INIT +_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_CONDATTR_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_condattr_init +# define pthread_condattr_init rpl_pthread_condattr_init +# endif +_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_CONDATTR_INIT@ +_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_condattr_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_condattr_init +# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT +_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_CONDATTR_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_condattr_destroy +# define pthread_condattr_destroy rpl_pthread_condattr_destroy +# endif +_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); +# else +# if !@HAVE_PTHREAD_CONDATTR_DESTROY@ +_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)); +# endif +_GL_CXXALIASWARN (pthread_condattr_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_condattr_destroy +# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY +_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_WAIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_wait +# define pthread_cond_wait rpl_pthread_cond_wait +# endif +_GL_FUNCDECL_RPL (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex)); +# else +# if !@HAVE_PTHREAD_COND_WAIT@ +_GL_FUNCDECL_SYS (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_wait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex)); +# endif +_GL_CXXALIASWARN (pthread_cond_wait); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_wait +# if HAVE_RAW_DECL_PTHREAD_COND_WAIT +_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_TIMEDWAIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_timedwait +# define pthread_cond_timedwait rpl_pthread_cond_timedwait +# endif +_GL_FUNCDECL_RPL (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2, 3))); +_GL_CXXALIAS_RPL (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime)); +# else +# if !@HAVE_PTHREAD_COND_TIMEDWAIT@ +_GL_FUNCDECL_SYS (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) + _GL_ARG_NONNULL ((1, 2, 3))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_timedwait, int, + (pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime)); +# endif +_GL_CXXALIASWARN (pthread_cond_timedwait); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_timedwait +# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT +_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_SIGNAL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_signal +# define pthread_cond_signal rpl_pthread_cond_signal +# endif +_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_SIGNAL@ +_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_signal); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_signal +# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL +_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_BROADCAST@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_broadcast +# define pthread_cond_broadcast rpl_pthread_cond_broadcast +# endif +_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_BROADCAST@ +_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_broadcast); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_broadcast +# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST +_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_COND@ +# if @REPLACE_PTHREAD_COND_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_cond_destroy +# define pthread_cond_destroy rpl_pthread_cond_destroy +# endif +_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond)); +# else +# if !@HAVE_PTHREAD_COND_DESTROY@ +_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)); +# endif +_GL_CXXALIASWARN (pthread_cond_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_cond_destroy +# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY +_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - " + "use gnulib module pthread-cond for portability"); +# endif +#endif + +/* =========== Thread-specific storage functions =========== */ + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_KEY_CREATE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_key_create +# define pthread_key_create rpl_pthread_key_create +# endif +_GL_FUNCDECL_RPL (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *)) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *))); +# else +# if !@HAVE_PTHREAD_KEY_CREATE@ +_GL_FUNCDECL_SYS (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *)) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_key_create, int, + (pthread_key_t *keyp, void (*destructor) (void *))); +# endif +_GL_CXXALIASWARN (pthread_key_create); +#elif defined GNULIB_POSIXCHECK +# undef pthread_key_create +# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE +_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_SETSPECIFIC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_setspecific +# define pthread_setspecific rpl_pthread_setspecific +# endif +_GL_FUNCDECL_RPL (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +_GL_CXXALIAS_RPL (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# else +# if !@HAVE_PTHREAD_SETSPECIFIC@ +_GL_FUNCDECL_SYS (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# endif +_GL_CXXALIAS_SYS (pthread_setspecific, int, + (pthread_key_t key, const void *value)); +# endif +_GL_CXXALIASWARN (pthread_setspecific); +#elif defined GNULIB_POSIXCHECK +# undef pthread_setspecific +# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC +_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_GETSPECIFIC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_getspecific +# define pthread_getspecific rpl_pthread_getspecific +# endif +_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key)); +_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key)); +# else +# if !@HAVE_PTHREAD_GETSPECIFIC@ +_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key)); +# endif +_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key)); +# endif +_GL_CXXALIASWARN (pthread_getspecific); +#elif defined GNULIB_POSIXCHECK +# undef pthread_getspecific +# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC +_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_TSS@ +# if @REPLACE_PTHREAD_KEY_DELETE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_key_delete +# define pthread_key_delete rpl_pthread_key_delete +# endif +_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key)); +_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key)); +# else +# if !@HAVE_PTHREAD_KEY_DELETE@ +_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key)); +# endif +_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key)); +# endif +_GL_CXXALIASWARN (pthread_key_delete); +#elif defined GNULIB_POSIXCHECK +# undef pthread_key_delete +# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE +_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - " + "use gnulib module pthread-tss for portability"); +# endif +#endif + +/* =========== Spinlock functions =========== */ + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_INIT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_init +# define pthread_spin_init rpl_pthread_spin_init +# endif +_GL_FUNCDECL_RPL (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes)); +# else +# if !@HAVE_PTHREAD_SPIN_INIT@ +_GL_FUNCDECL_SYS (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_init, int, + (pthread_spinlock_t *lock, int shared_across_processes)); +# endif +_GL_CXXALIASWARN (pthread_spin_init); +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_init +# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT +_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_LOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_lock +# define pthread_spin_lock rpl_pthread_spin_lock +# endif +_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_LOCK@ +_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_spin_lock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_lock +# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK +_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_TRYLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_trylock +# define pthread_spin_trylock rpl_pthread_spin_trylock +# endif +_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_TRYLOCK@ +_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_spin_trylock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_trylock +# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK +_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_UNLOCK@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_unlock +# define pthread_spin_unlock rpl_pthread_spin_unlock +# endif +_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_UNLOCK@ +_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_spin_unlock); +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_unlock +# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK +_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + +#if @GNULIB_PTHREAD_SPIN@ +# if @REPLACE_PTHREAD_SPIN_DESTROY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef pthread_spin_destroy +# define pthread_spin_destroy rpl_pthread_spin_destroy +# endif +_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); +# else +# if !@HAVE_PTHREAD_SPIN_DESTROY@ +_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)); +# endif +_GL_CXXALIASWARN (pthread_spin_destroy); +#elif defined GNULIB_POSIXCHECK +# undef pthread_spin_destroy +# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY +_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " + "use gnulib module pthread-spin for portability"); +# endif +#endif + + _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ diff --git a/m4/pthread_h.m4 b/m4/pthread_h.m4 index 689d41ddf9..da362556c7 100644 --- a/m4/pthread_h.m4 +++ b/m4/pthread_h.m4 @@ -1,4 +1,4 @@ -# pthread_h.m4 serial 2 +# pthread_h.m4 serial 3 dnl Copyright (C) 2009-2019 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -38,7 +38,27 @@ AC_DEFUN([gl_PTHREAD_H], dnl corresponding gnulib module is not in use, if it is not common dnl enough to be declared everywhere. gl_WARN_ON_USE_PREPARE([[#include - ]], [pthread_mutex_timedlock]) + ]], [ + pthread_create pthread_attr_init pthread_attr_getdetachstate + pthread_attr_setdetachstate pthread_attr_destroy pthread_self pthread_equal + pthread_detach pthread_join pthread_exit + pthread_once + pthread_mutex_init pthread_mutexattr_init pthread_mutexattr_gettype + pthread_mutexattr_settype pthread_mutexattr_getrobust + pthread_mutexattr_setrobust pthread_mutexattr_destroy pthread_mutex_lock + pthread_mutex_trylock pthread_mutex_timedlock pthread_mutex_unlock + pthread_mutex_destroy + pthread_rwlock_init pthread_rwlockattr_init pthread_rwlockattr_destroy + pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock + pthread_rwlock_trywrlock pthread_rwlock_timedrdlock + pthread_rwlock_timedwrlock pthread_rwlock_unlock pthread_rwlock_destroy + pthread_cond_init pthread_condattr_init pthread_condattr_destroy + pthread_cond_wait pthread_cond_timedwait pthread_cond_signal + pthread_cond_broadcast pthread_cond_destroy + pthread_key_create pthread_setspecific pthread_getspecific + pthread_key_delete + pthread_spin_init pthread_spin_lock pthread_spin_trylock pthread_spin_unlock + pthread_spin_destroy]) AC_REQUIRE([AC_C_RESTRICT]) @@ -58,10 +78,118 @@ AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR], AC_DEFUN([gl_PTHREAD_H_DEFAULTS], [ - GNULIB_PTHREAD=0; AC_SUBST([GNULIB_PTHREAD]) - GNULIB_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([GNULIB_PTHREAD_MUTEX_TIMEDLOCK]) + GNULIB_PTHREAD=0; AC_SUBST([GNULIB_PTHREAD]) + GNULIB_PTHREAD_THREAD=0; AC_SUBST([GNULIB_PTHREAD_THREAD]) + GNULIB_PTHREAD_ONCE=0; AC_SUBST([GNULIB_PTHREAD_ONCE]) + GNULIB_PTHREAD_MUTEX=0; AC_SUBST([GNULIB_PTHREAD_MUTEX]) + GNULIB_PTHREAD_RWLOCK=0; AC_SUBST([GNULIB_PTHREAD_RWLOCK]) + GNULIB_PTHREAD_COND=0; AC_SUBST([GNULIB_PTHREAD_COND]) + GNULIB_PTHREAD_TSS=0; AC_SUBST([GNULIB_PTHREAD_TSS]) + GNULIB_PTHREAD_SPIN=0; AC_SUBST([GNULIB_PTHREAD_SPIN]) + GNULIB_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([GNULIB_PTHREAD_MUTEX_TIMEDLOCK]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_PTHREAD_MUTEX_TIMEDLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK]) - HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T]) - HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T]) + HAVE_PTHREAD_SPINLOCK_T=1; AC_SUBST([HAVE_PTHREAD_SPINLOCK_T]) + HAVE_PTHREAD_T=1; AC_SUBST([HAVE_PTHREAD_T]) + HAVE_PTHREAD_CREATE=1; AC_SUBST([HAVE_PTHREAD_CREATE]) + HAVE_PTHREAD_ATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_ATTR_INIT]) + HAVE_PTHREAD_ATTR_GETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_GETDETACHSTATE]) + HAVE_PTHREAD_ATTR_SETDETACHSTATE=1; AC_SUBST([HAVE_PTHREAD_ATTR_SETDETACHSTATE]) + HAVE_PTHREAD_ATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_ATTR_DESTROY]) + HAVE_PTHREAD_SELF=1; AC_SUBST([HAVE_PTHREAD_SELF]) + HAVE_PTHREAD_EQUAL=1; AC_SUBST([HAVE_PTHREAD_EQUAL]) + HAVE_PTHREAD_DETACH=1; AC_SUBST([HAVE_PTHREAD_DETACH]) + HAVE_PTHREAD_JOIN=1; AC_SUBST([HAVE_PTHREAD_JOIN]) + HAVE_PTHREAD_EXIT=1; AC_SUBST([HAVE_PTHREAD_EXIT]) + HAVE_PTHREAD_ONCE=1; AC_SUBST([HAVE_PTHREAD_ONCE]) + HAVE_PTHREAD_MUTEX_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEX_INIT]) + HAVE_PTHREAD_MUTEXATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_INIT]) + HAVE_PTHREAD_MUTEXATTR_GETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETTYPE]) + HAVE_PTHREAD_MUTEXATTR_SETTYPE=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETTYPE]) + HAVE_PTHREAD_MUTEXATTR_GETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETROBUST]) + HAVE_PTHREAD_MUTEXATTR_SETROBUST=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETROBUST]) + HAVE_PTHREAD_MUTEXATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEXATTR_DESTROY]) + HAVE_PTHREAD_MUTEX_LOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_LOCK]) + HAVE_PTHREAD_MUTEX_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TRYLOCK]) + HAVE_PTHREAD_MUTEX_TIMEDLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK]) + HAVE_PTHREAD_MUTEX_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_MUTEX_UNLOCK]) + HAVE_PTHREAD_MUTEX_DESTROY=1; AC_SUBST([HAVE_PTHREAD_MUTEX_DESTROY]) + HAVE_PTHREAD_RWLOCK_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_INIT]) + HAVE_PTHREAD_RWLOCKATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_INIT]) + HAVE_PTHREAD_RWLOCKATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_DESTROY]) + HAVE_PTHREAD_RWLOCK_RDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_RDLOCK]) + HAVE_PTHREAD_RWLOCK_WRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_WRLOCK]) + HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYRDLOCK]) + HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYWRLOCK]) + HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK]) + HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK]) + HAVE_PTHREAD_RWLOCK_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_UNLOCK]) + HAVE_PTHREAD_RWLOCK_DESTROY=1; AC_SUBST([HAVE_PTHREAD_RWLOCK_DESTROY]) + HAVE_PTHREAD_COND_INIT=1; AC_SUBST([HAVE_PTHREAD_COND_INIT]) + HAVE_PTHREAD_CONDATTR_INIT=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_INIT]) + HAVE_PTHREAD_CONDATTR_DESTROY=1; AC_SUBST([HAVE_PTHREAD_CONDATTR_DESTROY]) + HAVE_PTHREAD_COND_WAIT=1; AC_SUBST([HAVE_PTHREAD_COND_WAIT]) + HAVE_PTHREAD_COND_TIMEDWAIT=1; AC_SUBST([HAVE_PTHREAD_COND_TIMEDWAIT]) + HAVE_PTHREAD_COND_SIGNAL=1; AC_SUBST([HAVE_PTHREAD_COND_SIGNAL]) + HAVE_PTHREAD_COND_BROADCAST=1; AC_SUBST([HAVE_PTHREAD_COND_BROADCAST]) + HAVE_PTHREAD_COND_DESTROY=1; AC_SUBST([HAVE_PTHREAD_COND_DESTROY]) + HAVE_PTHREAD_KEY_CREATE=1; AC_SUBST([HAVE_PTHREAD_KEY_CREATE]) + HAVE_PTHREAD_SETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_SETSPECIFIC]) + HAVE_PTHREAD_GETSPECIFIC=1; AC_SUBST([HAVE_PTHREAD_GETSPECIFIC]) + HAVE_PTHREAD_KEY_DELETE=1; AC_SUBST([HAVE_PTHREAD_KEY_DELETE]) + HAVE_PTHREAD_SPIN_INIT=1; AC_SUBST([HAVE_PTHREAD_SPIN_INIT]) + HAVE_PTHREAD_SPIN_LOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_LOCK]) + HAVE_PTHREAD_SPIN_TRYLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_TRYLOCK]) + HAVE_PTHREAD_SPIN_UNLOCK=1; AC_SUBST([HAVE_PTHREAD_SPIN_UNLOCK]) + HAVE_PTHREAD_SPIN_DESTROY=1; AC_SUBST([HAVE_PTHREAD_SPIN_DESTROY]) + REPLACE_PTHREAD_CREATE=0; AC_SUBST([REPLACE_PTHREAD_CREATE]) + REPLACE_PTHREAD_ATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_ATTR_INIT]) + REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_GETDETACHSTATE]) + REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_SETDETACHSTATE]) + REPLACE_PTHREAD_ATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_ATTR_DESTROY]) + REPLACE_PTHREAD_SELF=0; AC_SUBST([REPLACE_PTHREAD_SELF]) + REPLACE_PTHREAD_EQUAL=0; AC_SUBST([REPLACE_PTHREAD_EQUAL]) + REPLACE_PTHREAD_DETACH=0; AC_SUBST([REPLACE_PTHREAD_DETACH]) + REPLACE_PTHREAD_JOIN=0; AC_SUBST([REPLACE_PTHREAD_JOIN]) + REPLACE_PTHREAD_EXIT=0; AC_SUBST([REPLACE_PTHREAD_EXIT]) + REPLACE_PTHREAD_ONCE=0; AC_SUBST([REPLACE_PTHREAD_ONCE]) + REPLACE_PTHREAD_MUTEX_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_INIT]) + REPLACE_PTHREAD_MUTEXATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_INIT]) + REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETTYPE]) + REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETTYPE]) + REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETROBUST]) + REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETROBUST]) + REPLACE_PTHREAD_MUTEXATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_DESTROY]) + REPLACE_PTHREAD_MUTEX_LOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_LOCK]) + REPLACE_PTHREAD_MUTEX_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TRYLOCK]) + REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_TIMEDLOCK]) + REPLACE_PTHREAD_MUTEX_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_UNLOCK]) + REPLACE_PTHREAD_MUTEX_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_MUTEX_DESTROY]) + REPLACE_PTHREAD_RWLOCK_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_INIT]) + REPLACE_PTHREAD_RWLOCKATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_INIT]) + REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_DESTROY]) + REPLACE_PTHREAD_RWLOCK_RDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_RDLOCK]) + REPLACE_PTHREAD_RWLOCK_WRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_WRLOCK]) + REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYRDLOCK]) + REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYWRLOCK]) + REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK]) + REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK]) + REPLACE_PTHREAD_RWLOCK_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_UNLOCK]) + REPLACE_PTHREAD_RWLOCK_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_RWLOCK_DESTROY]) + REPLACE_PTHREAD_COND_INIT=0; AC_SUBST([REPLACE_PTHREAD_COND_INIT]) + REPLACE_PTHREAD_CONDATTR_INIT=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_INIT]) + REPLACE_PTHREAD_CONDATTR_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_CONDATTR_DESTROY]) + REPLACE_PTHREAD_COND_WAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_WAIT]) + REPLACE_PTHREAD_COND_TIMEDWAIT=0; AC_SUBST([REPLACE_PTHREAD_COND_TIMEDWAIT]) + REPLACE_PTHREAD_COND_SIGNAL=0; AC_SUBST([REPLACE_PTHREAD_COND_SIGNAL]) + REPLACE_PTHREAD_COND_BROADCAST=0; AC_SUBST([REPLACE_PTHREAD_COND_BROADCAST]) + REPLACE_PTHREAD_COND_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_COND_DESTROY]) + REPLACE_PTHREAD_KEY_CREATE=0; AC_SUBST([REPLACE_PTHREAD_KEY_CREATE]) + REPLACE_PTHREAD_SETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_SETSPECIFIC]) + REPLACE_PTHREAD_GETSPECIFIC=0; AC_SUBST([REPLACE_PTHREAD_GETSPECIFIC]) + REPLACE_PTHREAD_KEY_DELETE=0; AC_SUBST([REPLACE_PTHREAD_KEY_DELETE]) + REPLACE_PTHREAD_SPIN_INIT=0; AC_SUBST([REPLACE_PTHREAD_SPIN_INIT]) + REPLACE_PTHREAD_SPIN_LOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_LOCK]) + REPLACE_PTHREAD_SPIN_TRYLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_TRYLOCK]) + REPLACE_PTHREAD_SPIN_UNLOCK=0; AC_SUBST([REPLACE_PTHREAD_SPIN_UNLOCK]) + REPLACE_PTHREAD_SPIN_DESTROY=0; AC_SUBST([REPLACE_PTHREAD_SPIN_DESTROY]) ]) diff --git a/modules/pthread-h b/modules/pthread-h index 3054ce45c0..71b6c65ae2 100644 --- a/modules/pthread-h +++ b/modules/pthread-h @@ -11,6 +11,10 @@ extern-inline sched time threadlib +snippet/c++defs +snippet/_Noreturn +snippet/arg-nonnull +snippet/warn-on-use configure.ac-early: AC_DEFINE([_REENTRANT], 1, [For thread-safety on OSF/1, Solaris.]) @@ -24,7 +28,7 @@ BUILT_SOURCES += pthread.h # We need the following in order to create when the system # doesn't have one that works with the given compiler. -pthread.h: pthread.in.h $(top_builddir)/config.status +pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ @@ -34,11 +38,123 @@ pthread.h: pthread.in.h $(top_builddir)/config.status -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \ -e 's/@''GNULIB_PTHREAD''@/$(GNULIB_PTHREAD)/g' \ + -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GNULIB_PTHREAD_THREAD)/g' \ + -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GNULIB_PTHREAD_ONCE)/g' \ + -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GNULIB_PTHREAD_MUTEX)/g' \ + -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GNULIB_PTHREAD_RWLOCK)/g' \ + -e 's/@''GNULIB_PTHREAD_COND''@/$(GNULIB_PTHREAD_COND)/g' \ + -e 's/@''GNULIB_PTHREAD_TSS''@/$(GNULIB_PTHREAD_TSS)/g' \ + -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GNULIB_PTHREAD_SPIN)/g' \ -e 's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \ - -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \ -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \ - < $(srcdir)/pthread.in.h; \ + -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \ + -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \ + -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \ + -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \ + -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \ + -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \ + < $(srcdir)/pthread.in.h | \ + sed -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g' \ + -e 's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \ + -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \ + -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \ + -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \ + -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \ + -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \ + -e 's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \ + -e 's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \ + -e 's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \ + -e 's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _Noreturn/r $(_NORETURN_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \ } > $@-t && \ mv $@-t $@ MOSTLYCLEANFILES += pthread.h pthread.h-t diff --git a/tests/test-pthread-c++.cc b/tests/test-pthread-c++.cc index dff13f884f..60e845cc48 100644 --- a/tests/test-pthread-c++.cc +++ b/tests/test-pthread-c++.cc @@ -24,11 +24,270 @@ #include "signature.h" +/* =========== Thread functions =========== */ + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_create, int, + (pthread_t *, const pthread_attr_t *, + void * (*) (void*), void *)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_init, int, (pthread_attr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_getdetachstate, int, + (pthread_attr_t *, int *)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_setdetachstate, int, + (pthread_attr_t *, int)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_destroy, int, + (pthread_attr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_self, pthread_t, (void)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_equal, int, (pthread_t, pthread_t)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_detach, int, (pthread_t)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_join, int, (pthread_t, void **)); +#endif + +#if GNULIB_TEST_PTHREAD_THREAD +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_exit, _Noreturn void, (void *)); +#endif + +/* =========== Once-only control (initialization) functions =========== */ + +#if GNULIB_TEST_PTHREAD_ONCE +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_once, int, + (pthread_once_t *, void (*) (void))); +#endif + +/* =========== Mutex functions =========== */ + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_init, int, + (pthread_mutex_t *, const pthread_mutexattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_init, int, + (pthread_mutexattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_gettype, int, + (const pthread_mutexattr_t *, int *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_settype, int, + (pthread_mutexattr_t *, int)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_getrobust, int, + (const pthread_mutexattr_t *, int *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_setrobust, int, + (pthread_mutexattr_t *, int)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_destroy, int, + (pthread_mutexattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_lock, int, + (pthread_mutex_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_trylock, int, + (pthread_mutex_t *)); +#endif + #if GNULIB_TEST_PTHREAD_MUTEX_TIMEDLOCK SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_timedlock, int, (pthread_mutex_t *, const struct timespec *)); #endif +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_unlock, int, + (pthread_mutex_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_MUTEX +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_destroy, int, + (pthread_mutex_t *)); +#endif + +/* =========== Read-write lock functions =========== */ + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_init, int, + (pthread_rwlock_t *, const pthread_rwlockattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlockattr_init, int, + (pthread_rwlockattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlockattr_destroy, int, + (pthread_rwlockattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_rdlock, int, + (pthread_rwlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_wrlock, int, + (pthread_rwlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_tryrdlock, int, + (pthread_rwlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_trywrlock, int, + (pthread_rwlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_timedrdlock, int, + (pthread_rwlock_t *, const struct timespec *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_timedwrlock, int, + (pthread_rwlock_t *, const struct timespec *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_unlock, int, + (pthread_rwlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_RWLOCK +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_destroy, int, + (pthread_rwlock_t *)); +#endif + +/* =========== Condition variable functions =========== */ + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_init, int, + (pthread_cond_t *, const pthread_condattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_condattr_init, int, + (pthread_condattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_condattr_destroy, int, + (pthread_condattr_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_wait, int, + (pthread_cond_t *, pthread_mutex_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_timedwait, int, + (pthread_cond_t *, pthread_mutex_t *, + const struct timespec *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_signal, int, + (pthread_cond_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_broadcast, int, + (pthread_cond_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_COND +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_destroy, int, + (pthread_cond_t *)); +#endif + +/* =========== Thread-specific storage functions =========== */ + +#if GNULIB_TEST_PTHREAD_TSS +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_key_create, int, + (pthread_key_t *, void (*) (void *))); +#endif + +#if GNULIB_TEST_PTHREAD_TSS +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_setspecific, int, + (pthread_key_t, const void *)); +#endif + +#if GNULIB_TEST_PTHREAD_TSS +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_getspecific, void *, + (pthread_key_t)); +#endif + +#if GNULIB_TEST_PTHREAD_TSS +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_key_delete, int, (pthread_key_t)); +#endif + +/* =========== Spinlock functions =========== */ + +#if GNULIB_TEST_PTHREAD_SPIN +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_init, int, + (pthread_spinlock_t *, int)); +#endif + +#if GNULIB_TEST_PTHREAD_SPIN +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_lock, int, + (pthread_spinlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_SPIN +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_trylock, int, + (pthread_spinlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_SPIN +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_unlock, int, + (pthread_spinlock_t *)); +#endif + +#if GNULIB_TEST_PTHREAD_SPIN +SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_destroy, int, + (pthread_spinlock_t *)); +#endif + int main ()