Mercurial > hg > octave-kai > gnulib-hg
view modules/pthread @ 17422:08883714ab3e
regex: adapt to locking regime instead of depending on pthread
Instead of depending on pthread, adapt to whatever thread
modules are in use. Problem reported by Ludovic Courtès in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00082.html>
and by Mats Erik Andersson in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-05/msg00100.html>.
* lib/regex_internal.h (lock_define, lock_init, lock_fini):
Support either the 'lock' module, or the 'pthread' module, or
no module.
(lock_lock, lock_unlock): New macros.
* lib/regexec.c (regexec, re_search_stub): Use the new macros.
* modules/lock, modules/pthread (configure.ac): Add module indicator.
* modules/regex (Depends-on): Remove pthread.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 29 May 2013 10:24:17 -0700 |
parents | 8b10fbdb551e |
children |
line wrap: on
line source
Description: Implement a trivial subset of the pthreads library. Files: lib/pthread.c lib/pthread.in.h m4/pthread.m4 Depends-on: extern-inline sched time configure.ac: gl_PTHREAD_CHECK gl_MODULE_INDICATOR([pthread]) Makefile.am: BUILT_SOURCES += $(PTHREAD_H) # We need the following in order to create <pthread.h> when the system # doesn't have one that works with the given compiler. if GL_GENERATE_PTHREAD_H pthread.h: pthread.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ sed -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -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|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \ -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \ < $(srcdir)/pthread.in.h; \ } > $@-t && \ mv $@-t $@ else pthread.h: $(top_builddir)/config.status rm -f $@ endif MOSTLYCLEANFILES += pthread.h pthread.h-t Include: <pthread.h> Link: $(LIB_PTHREAD) License: LGPLv2+ Maintainer: Glen Lenker and Paul Eggert