From e7b9404a99d66bfcc3021e886c5a366894bdc9e0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 15 Jul 2019 02:41:05 +0200 Subject: [PATCH] pthread: Turn into a convenience module. * lib/pthread.in.h: Remove declarations for extern inline functions. * lib/pthread.c: Remove file. * modules/pthread (Files): Remove it. (Depends-on): Add pthread-thread, pthread-once, pthread-mutex, pthread-rwlock, pthread-cond, pthread-tss, pthread-spin. (configure.ac): Don't compile lib/pthread.c. Don't set GNULIB_PTHREAD. * m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Don't initialize GNULIB_PTHREAD. * modules/pthread-h (Makefile.am): Don't substitute GNULIB_PTHREAD. --- ChangeLog | 13 +++++++++++++ lib/pthread.c | 4 ---- lib/pthread.in.h | 10 ---------- m4/pthread_h.m4 | 1 - modules/pthread | 12 +++++++----- modules/pthread-h | 1 - 6 files changed, 20 insertions(+), 21 deletions(-) delete mode 100644 lib/pthread.c diff --git a/ChangeLog b/ChangeLog index ebe77e15c2..1144af36b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2019-07-14 Bruno Haible + + pthread: Turn into a convenience module. + * lib/pthread.in.h: Remove declarations for extern inline functions. + * lib/pthread.c: Remove file. + * modules/pthread (Files): Remove it. + (Depends-on): Add pthread-thread, pthread-once, pthread-mutex, + pthread-rwlock, pthread-cond, pthread-tss, pthread-spin. + (configure.ac): Don't compile lib/pthread.c. Don't set GNULIB_PTHREAD. + * m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Don't initialize + GNULIB_PTHREAD. + * modules/pthread-h (Makefile.am): Don't substitute GNULIB_PTHREAD. + 2019-07-14 Bruno Haible pthread-spin: New module. diff --git a/lib/pthread.c b/lib/pthread.c deleted file mode 100644 index 188eb0a94c..0000000000 --- a/lib/pthread.c +++ /dev/null @@ -1,4 +0,0 @@ -#include -#define _GL_PTHREAD_INLINE _GL_EXTERN_INLINE -#include "pthread.h" -typedef int dummy; diff --git a/lib/pthread.in.h b/lib/pthread.in.h index d0f3ad8bda..c8963c832b 100644 --- a/lib/pthread.in.h +++ b/lib/pthread.in.h @@ -77,14 +77,6 @@ /* The definition of _GL_WARN_ON_USE is copied here. */ -#ifndef _GL_INLINE_HEADER_BEGIN - #error "Please include config.h first." -#endif -_GL_INLINE_HEADER_BEGIN -#ifndef _GL_PTHREAD_INLINE -# define _GL_PTHREAD_INLINE _GL_INLINE -#endif - /* =========== Thread types and macros =========== */ #if @GNULIB_PTHREAD_THREAD@ && (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS @@ -1720,8 +1712,6 @@ _GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - " #endif -_GL_INLINE_HEADER_END - #endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ #endif /* _@GUARD_PREFIX@_PTHREAD_H_ */ #endif diff --git a/m4/pthread_h.m4 b/m4/pthread_h.m4 index a35e748a87..8c23a77794 100644 --- a/m4/pthread_h.m4 +++ b/m4/pthread_h.m4 @@ -140,7 +140,6 @@ AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR], AC_DEFUN([gl_PTHREAD_H_DEFAULTS], [ - 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]) diff --git a/modules/pthread b/modules/pthread index a778cb163f..c9c5614b21 100644 --- a/modules/pthread +++ b/modules/pthread @@ -2,16 +2,18 @@ Description: Implement the most essential subset of the pthreads library. Files: -lib/pthread.c Depends-on: pthread-h +pthread-thread +pthread-once +pthread-mutex +pthread-rwlock +pthread-cond +pthread-tss +pthread-spin configure.ac: -if test $HAVE_PTHREAD_H = 0 || test $HAVE_PTHREAD_T = 0 || test $HAVE_PTHREAD_SPINLOCK_T = 0; then - AC_LIBOBJ([pthread]) -fi -gl_MODULE_INDICATOR([pthread]) Makefile.am: diff --git a/modules/pthread-h b/modules/pthread-h index 12ba70a719..3a9c1501c3 100644 --- a/modules/pthread-h +++ b/modules/pthread-h @@ -37,7 +37,6 @@ pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -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' \ -- 2.39.5