> > * We establish a new macro GNULIB_MBTOWC_SINGLE which means "assume that > > at most one thread invokes mbtowc-like functions". The mbtowc > > replacement uses this instead of using USE_UNLOCKED_IO. Tar can #define > > this new macro. > > I like this idea. The packages can then define or not define each such > macro individually. Implemented through the following series of patches. 2021-03-07 Bruno Haible Rename GNULIB_WCHAR_SINGLE to GNULIB_WCHAR_SINGLE_LOCALE. * lib/lc-charset-dispatch.c: Test GNULIB_WCHAR_SINGLE_LOCALE instead of GNULIB_WCHAR_SINGLE. * lib/wcwidth.c: Likewise. * tests/test-wcwidth.c: Likewise. * doc/multithread.texi: Document GNULIB_WCHAR_SINGLE_LOCALE instead of GNULIB_WCHAR_SINGLE. * NEWS: Document the change. 2021-03-06 Bruno Haible mbrtowc: Allow locking optimization independently of 'unlocked-io'. * lib/mbtowc-lock.h: Test GNULIB_MBRTOWC_SINGLE_THREAD instead of USE_UNLOCKED_IO. * doc/multithread.texi: Document GNULIB_MBRTOWC_SINGLE_THREAD. 2021-03-06 Bruno Haible 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 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. 2021-03-06 Bruno Haible mountlist: Optimize stdio accesses. * lib/mountlist.c: Include unlocked-io.h unconditionally. * modules/mountlist (Depends-on): Add unlocked-io-internal. 2021-03-06 Bruno Haible getusershell: Optimize stdio accesses when possible. * lib/getusershell.c: Test GNULIB_GETUSERSHELL_SINGLE_THREAD instead of USE_UNLOCKED_IO. * modules/getusershell (Depends-on): Add unlocked-io-internal. * doc/multithread.texi: Document GNULIB_GETUSERSHELL_SINGLE_THREAD. 2021-03-06 Bruno Haible unlocked-io-internal: New module. * m4/unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO): Don't define USE_UNLOCKED_IO here. * modules/unlocked-io-internal: New file, based on modules/unlocked-io. * modules/unlocked-io (Description): Clarify. (Files, Depends-on): Just use the unlocked-io-internal module. (configure.ac): Define GNULIB_STDIO_SINGLE_THREAD and USE_UNLOCKED_IO here. * doc/multithread.texi: Clarify when the 'unlocked-io' module can be used. 2021-03-06 Bruno Haible posixtm: Remove unused includes. * lib/posixtm.c: Don't include , , unlocked-io.h.