regex: adapt to locking regime instead of depending on pthread
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 May 2013 17:24:17 +0000 (10:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 29 May 2013 17:24:38 +0000 (10:24 -0700)
commit55ba71f47850fbd870cb08bac1cf992f1368295e
tree0cee0ddc976e50cfc404e973077b837fd326c3bd
parente28fbd787cb4861a7848ac6e86c838912b8cd2ec
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.
ChangeLog
lib/regex_internal.h
lib/regexec.c
modules/lock
modules/pthread
modules/regex