Hi Joerg,

2015-06-24 13:19 GMT+02:00 Joerg Sonnenberger <[email protected]>:
> Note that setlocale() *is* thread-safe on a correctly implemented UNIX.
> It is a bug if you don't get consistent results with a clear
> before-after semantic even when other threads call locale-sensitive
> funcctions concurrently.

Oh, sorry about the last mail. I misread your sentence slightly.

Let me clarify: the intent behind this knob is that it allows you to
filter out functions that would cause you to write code that affects
the execution of other threads in unintended ways.

I've seen libraries out there that call setlocale(LC_ALL, ""), having
full disregard for any other code that runs within the same
application. By adding this knob, such pieces of code can be detected
more easily.

So even though I agree with you that setlocale() can be implemented in
a thread-safe way on UNIX (read: the execution of the setlocale
function itself is thread-safe), it is harmful to use in larger-scale
programs.

-- 
Ed Schouten <[email protected]>
Nuxi, 's-Hertogenbosch, the Netherlands
KvK/VAT number: 62051717
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to