diff options
author | Bruno Haible <bruno@clisp.org> | 2021-03-07 02:57:46 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-03-07 11:02:00 +0100 |
commit | cd057fa80c74dcf1d0a74290cb5ad6cdc3136428 (patch) | |
tree | e8eb90065d394df0be33f92ff83fac94b56d4f30 /lib | |
parent | ede75ad3eeeafe72d1af9de84897905edf76bd70 (diff) | |
download | gnulib-cd057fa80c74dcf1d0a74290cb5ad6cdc3136428.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mbtowc-lock.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mbtowc-lock.h b/lib/mbtowc-lock.h index b7c5ba8a08..3b6f5f9696 100644 --- a/lib/mbtowc-lock.h +++ b/lib/mbtowc-lock.h @@ -32,7 +32,9 @@ mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m) /* Prohibit renaming this symbol. */ #undef gl_get_mbtowc_lock -#ifdef USE_UNLOCKED_IO +#if GNULIB_MBRTOWC_SINGLE_THREAD + +/* All uses of this function are in a single thread. No locking needed. */ static int mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m) |