[cfe-dev] __thread keyword, LLVM 3.2 & Xcode 4.6

James Gregurich bayoubengal at me.com
Tue Nov 6 10:51:15 PST 2012

On Nov 6, 2012, at 1:04 AM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:

> The __thread keyword is a C extension (it not part of the standard). Using it with C++ as is even less specified than using it with C.


If the 'thread_local' keyword was implemented, I'd use that…but it isn't implemented, so I'm testing with what is there. I don't really care what the keyword is.

> Moreover, it has already be specified in the previous discussion that supporting C++ TLS required OS support. Updating Xcode does not change that. 

You'll recall that it was suggested to me that LLVM 3.2 offered something new and interesting in that regard. So, I was checking it out. It didn't work as I expected, so, simply put...I was asking for education. Eli then gave me the meaningful answer that allowed me to understand what was happening.  The question for me is…   is what is implemented good enough for me to replace boost::thread_specific_ptr on 10.7+.

BTW: I went looking for clear and precise documentation on the web about clang's built-in support for thread-local storage, but I could not find it. Had I found that, I would not have come here asking questions about it.


More information about the cfe-dev mailing list