<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">BTW:<div><br></div><div>What is the lifetime on a __thread variable?  It gets destructed at the time the thread exits?<br><div><br></div><div><br></div><div><br><div><div>On Oct 16, 2012, at 2:06 PM, James Gregurich <<a href="mailto:bayoubengal@me.com">bayoubengal@me.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>thanks all for the info. </div><br><div><div>On Oct 16, 2012, at 1:59 PM, James Gregurich <<a href="mailto:bayoubengal@me.com">bayoubengal@me.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>hmmm.   I just ran the test against the 10.7 SDK again and it worked. I'm not sure what I had wrong the first time. </div><div><br></div><div>ok.  "__thread" works for me. I have to encapsulate the implementation anyway as my code currently uses boost::thread_specific_ptr and it must continue to work on 10.6. </div><div><br></div><div><br></div><div><br></div><div><br><div><div>On Oct 16, 2012, at 1:45 PM, Jean-Daniel Dupas <<a href="mailto:devlists@shadowlab.org">devlists@shadowlab.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Can you define "does not work" ? <div><br></div><div>I just compiled the following code in C++ mode, and it generate the expected llvm assembly:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">__thread <span style="color: #bb2ca2">int</span> foo;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="color: #bb2ca2">int</span> main(<span style="color: #bb2ca2">int</span> arcg, <span style="color: #bb2ca2">char</span> **argv) { <span style="color: #bb2ca2">return</span> <span style="color: #272ad8">0</span>; }</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">====== output:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><div style="margin: 0px; ">@foo = thread_local global i32 <span style="color: #272ad8">0</span>, align <span style="color: #272ad8">4</span></div><div style="margin: 0px; min-height: 13px; "><br></div><div style="margin: 0px; ">define i32 @main(i32 %arcg, i8** %argv) nounwind uwtable ssp {</div><div style="margin: 0px; ">entry:</div><div style="margin: 0px; ">  %retval = alloca i32, align <span style="color: #272ad8">4</span></div><div style="margin: 0px; "><span style="color: #272ad8">…</span></div><div style="margin: 0px; "><span style="color: #272ad8"><br></span></div><div style="margin: 0px; "><span style="color: #272ad8"><br></span></div></div><div><br><div><div>Le 16 oct. 2012 à 22:40, James Gregurich <<a href="mailto:bayoubengal@me.com">bayoubengal@me.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite">Is it C-only? I ran a test with C++ and it didn't work. Does it work with C++ and I need to supply some flag to compiler to enable it? I'll poke around with google and see what info I can dig up.<br><br><br><br><br>On Oct 16, 2012, at 1:34 PM, Jean-Daniel Dupas <<a href="mailto:devlists@shadowlab.org">devlists@shadowlab.org</a>> wrote:<br><br><blockquote type="cite"><br>Le 16 oct. 2012 à 21:04, James Gregurich <<a href="mailto:bayoubengal@me.com">bayoubengal@me.com</a>> a écrit :<br><br><blockquote type="cite">howdy!<br><br>What is the status of 'thread_local' support in clang? is that something that will be delivered in the next few months? later? never will be delivered? has been delivered, but the website not updated?<br><br></blockquote><br>AFAIK, thread locals are supported in C using the __thread keyword on platform that support it for some times (OS X 10.7 for Mach-O, ELF platforms, …).<br><br><br>-- Jean-Daniel<br><br><br><br><br><br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote><br></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></div></div></div></blockquote></div><br></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></blockquote></div><br></div></blockquote></div><br></div></div></body></html>