This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Potential locking issue in newlocale
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libc-alpha at sources dot redhat dot com, Ulrich dot Weigand at de dot ibm dot com, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 16 Jul 2004 13:10:48 +0200
- Subject: Re: Potential locking issue in newlocale
- References: <40F79EAB.1060107@suse.de> <20040716092207.GF30497@sunsite.ms.mff.cuni.cz>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 16, 2004 at 11:22:07AM +0200, Jakub Jelinek wrote:
> My biggest surprise is the
> const int max_locales = 10;
> ...
> for (int i = 0; i < max_loop_count; ++i)
> {
> int k = i % max_locales;
> loc[k] = std::locale::global(loc[k]);
>
> if (i % 37 == 0)
> loc[k] = loc[k].combine<std::ctype<char> >(loc_c);
> }
> loop is not actually modulo 10, but modulo 11 in the C library calls,
Oops, my bad, that is correct because of the loc[k] = assignment.
Sorry.
Jakub