This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Potential locking issue in newlocale


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]