+2021-03-06 Bruno Haible <bruno@clisp.org>
+
+ regex: Allow locking optimization independently of 'unlocked-io'.
+ * lib/regex_internal.h: Test GNULIB_REGEX_SINGLE_THREAD instead of
+ USE_UNLOCKED_IO.
+ * doc/multithread.texi: Document GNULIB_REGEX_SINGLE_THREAD.
+
2021-03-06 Bruno Haible <bruno@clisp.org>
exclude: Allow stdio optimization independently of 'unlocked-io'.
@code{"unlocked-io.h"} header file. Some Gnulib modules that do operations
on @code{FILE} streams have these preparations already included.
@item
+You may define the C macro @code{GNULIB_REGEX_SINGLE_THREAD}, if all the
+programs in your package invoke the functions of the @code{regex} module
+only from a single thread.
+@item
You may define the C macro @code{GNULIB_WCHAR_SINGLE}, if all the programs in
your package are single-threaded and won't change the locale after it has
been initialized. This macro optimizes the functions @code{mbrtowc} and
# define lock_fini(lock) ((void) 0)
# define lock_lock(lock) __libc_lock_lock (lock)
# define lock_unlock(lock) __libc_lock_unlock (lock)
-#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_LOCK && !defined GNULIB_REGEX_SINGLE_THREAD
# include "glthread/lock.h"
# define lock_define(name) gl_lock_define (, name)
# define lock_init(lock) glthread_lock_init (&(lock))
# define lock_fini(lock) glthread_lock_destroy (&(lock))
# define lock_lock(lock) glthread_lock_lock (&(lock))
# define lock_unlock(lock) glthread_lock_unlock (&(lock))
-#elif defined GNULIB_PTHREAD && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_PTHREAD && !defined GNULIB_REGEX_SINGLE_THREAD
# include <pthread.h>
# define lock_define(name) pthread_mutex_t name;
# define lock_init(lock) pthread_mutex_init (&(lock), 0)