summaryrefslogtreecommitdiff
path: root/modules/pthread
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-06-20 04:02:52 +0200
committerBruno Haible <bruno@clisp.org>2019-06-20 04:02:52 +0200
commit145e16d89f89e000ff6a4f1892b17e34560f9e96 (patch)
tree069f90958e8fb245aa28056b5d266a2827042aa6 /modules/pthread
parent79c2545308000d2120009a76bea4f36f06f16b1b (diff)
downloadgnulib-145e16d89f89e000ff6a4f1892b17e34560f9e96.tar.gz
pthread_mutex_timedlock: New module.
* lib/pthread.in.h (pthread_mutex_timedlock): New dummy function and new declaration. * lib/pthread_mutex_timedlock.c: New file. * m4/pthread_mutex_timedlock.m4: New file. * m4/pthread.m4 (gl_PTHREAD_CHECK): Don't call AC_LIBOBJ here. Test whether pthread_mutex_timedlock is declared. (gl_PTHREAD_MODULE_INDICATOR): New macro. (gl_PTHREAD_DEFAULTS): Initialize GNULIB_PTHREAD_MUTEX_TIMEDLOCK, HAVE_PTHREAD_MUTEX_TIMEDLOCK. * modules/pthread (configure.ac): Call AC_LIBOBJ here. (Makefile.am): Substitute GNULIB_PTHREAD_MUTEX_TIMEDLOCK, HAVE_PTHREAD_MUTEX_TIMEDLOCK. * modules/pthread_mutex_timedlock: New file. * doc/posix-functions/pthread_mutex_timedlock.texi: Mention the new module.
Diffstat (limited to 'modules/pthread')
-rw-r--r--modules/pthread5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/pthread b/modules/pthread
index 3fb39208ab..81e2aad384 100644
--- a/modules/pthread
+++ b/modules/pthread
@@ -18,6 +18,9 @@ AC_DEFINE([_THREAD_SAFE], 1, [For thread-safety on AIX, FreeBSD.])
configure.ac:
gl_PTHREAD_CHECK
+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:
@@ -35,8 +38,10 @@ pthread.h: pthread.in.h $(top_builddir)/config.status
-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_MUTEX_TIMEDLOCK''@/$(GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \
-e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \
-e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \
+ -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
< $(srcdir)/pthread.in.h; \
} > $@-t && \
mv $@-t $@