www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15523] New: extern(C++) support TLS (C++ 'thread_local')

https://issues.dlang.org/show_bug.cgi?id=15523

          Issue ID: 15523
           Summary: extern(C++) support TLS (C++ 'thread_local') linkage?
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

We typically use __gshared when extern(C++) to global data.

'thread_local' is becoming common in C++ code (I have quite a few); is it
possible to support non-gshared extern(C++) to mangle as C++ 'thread_local'
variables?

The obvious question is, is D's TLS and C++'s TLS strategy compatible? Possible
to support C++ TLS in D?
I'm sure this is trivial for GCC and Clang, I expect it's nothing more than
mangling there?

--
Jan 06 2016