>From f4bf3936b988eb65361e04b0ca3898681b787c58 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 7 Mar 2021 02:42:24 +0100 Subject: [PATCH 6/9] exclude: Allow stdio optimization independently of 'unlocked-io'. * lib/exclude.c: Test GNULIB_EXCLUDE_SINGLE_THREAD instead of USE_UNLOCKED_IO. * modules/exclude (Depends-on): Add unlocked-io-internal. * doc/multithread.texi: Document GNULIB_EXCLUDE_SINGLE_THREAD. --- ChangeLog | 8 ++++++++ doc/multithread.texi | 4 ++++ lib/exclude.c | 2 +- modules/exclude | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 47f6807..d2ffff0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2021-03-06 Bruno Haible + exclude: Allow stdio optimization independently of 'unlocked-io'. + * lib/exclude.c: Test GNULIB_EXCLUDE_SINGLE_THREAD instead of + USE_UNLOCKED_IO. + * modules/exclude (Depends-on): Add unlocked-io-internal. + * doc/multithread.texi: Document GNULIB_EXCLUDE_SINGLE_THREAD. + +2021-03-06 Bruno Haible + readutmp: Optimize stdio accesses. * lib/readutmp.c: Include unlocked-io.h unconditionally. * modules/readutmp (Depends-on): Add unlocked-io-internal. diff --git a/doc/multithread.texi b/doc/multithread.texi index a63d3ee..082ccb0 100644 --- a/doc/multithread.texi +++ b/doc/multithread.texi @@ -278,4 +278,8 @@ been initialized. This macro optimizes the functions @code{mbrtowc} and You may define the C macro @code{GNULIB_GETUSERSHELL_SINGLE_THREAD}, if all the programs in your package invoke the functions @code{setusershell}, @code{getusershell}, @code{endusershell} only from a single thread. +@item +You may define the C macro @code{GNULIB_EXCLUDE_SINGLE_THREAD}, if all the +programs in your package invoke the functions of the @code{exclude} module +only from a single thread. @end itemize diff --git a/lib/exclude.c b/lib/exclude.c index a9c4e68..4ef4e08 100644 --- a/lib/exclude.c +++ b/lib/exclude.c @@ -42,7 +42,7 @@ #include "verify.h" #include "filename.h" -#if USE_UNLOCKED_IO +#if GNULIB_EXCLUDE_SINGLE_THREAD # include "unlocked-io.h" #endif diff --git a/modules/exclude b/modules/exclude index 2529027..13871bd 100644 --- a/modules/exclude +++ b/modules/exclude @@ -14,6 +14,7 @@ mbscasecmp mbuiter regex stdbool +unlocked-io-internal verify xalloc -- 2.7.4