[llvm-commits] Reworked SwitchInst prototype with case-ranges.

Chandler Carruth chandlerc at google.com
Fri Sep 7 01:38:35 PDT 2012


On Fri, Sep 7, 2012 at 4:28 AM, Nuno Lopes <nunoplopes at sapo.pt> wrote:

> Quoting Nick Lewycky <nicholas at mxc.ca>:
>
>  Nuno Lopes wrote:
>>
>>> - Please don't use function static variables. It's not good for thread
>>> safety.
>>>
>>
>> Excuse me? On what platform are function local statics not thread safe?
>> I've been known to advocate using function local statics as the solution to
>> threading problems.
>>
>
> As far as I understand, the initialization of these variables is
> guaranteed to be thread safe by the standard, but not the access to them.
> That means that doing '++counter;' is not thread safe.


Yea, sorry if i wasn't clear either, my comment only pertains to
initialization.

C++11 added this requirement, GCC and Clang have for a long time emitted
code according to this regardless of the standard requested, Older versions
of MSVC definitely do not support it, and I don't know off hand which
version added (or will add) support.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120907/71d6c068/attachment.html>


More information about the llvm-commits mailing list