<div dir="ltr"><div>Hi,</div><div><br></div><div class="gmail_extra"><div class="gmail_quote">2014-03-24 17:58 GMT+01:00 Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Note that std::once can be used to enforce "run once" and we don't have to worry about each platform (like we would have to if we used pthread_once).<br>
<br>
Modified version submitted with:<br>
<br>
Author: gclayton<br>
Date: Mon Mar 24 11:50:33 2014<br>
New Revision: 204622<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=204622&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=204622&view=rev</a><br>
Log:<br>
Modified patch from Piotr Rak that makes GetSharedModuleList() more thread safe and also fixed a missed member initialization on the copy contractor and also makes the assignment operator safer.<br>
<br>
Modified:<br>
lldb/trunk/source/Core/ModuleList.cpp<br>
<div><div class="h5"><span style="color:rgb(34,34,34)"> </span></div></div></blockquote><div><br></div>Thanks, that's great we can use that, I have not seen any use of std::once, and that's why I was avoiding it.<div>
Like I avoided ranged version of for before I have noticed we already use it.</div><div>I've seen comments about lack of atomic for Windows in debug shared_ptr implementation, and also we wrap things like mutex, condition variable, etc...</div>
<div><br></div><div>For future:</div><div>Are there any clear guidelines what feature set form C++11 is safe to use?</div><div>Or we shouldn't limit ourselves until someone starts screaming out laud?</div><div><br></div>
<div class="gmail_extra">Cheers,</div><div class="gmail_extra">/Piotr</div><div> </div></div></div></div>