<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 27, 2015, at 8:05 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class=""><br class="">
On Feb 27, 2015 7:52 AM, "Mehdi AMINI" <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>> wrote:<br class="">
><br class="">
> ================<br class="">
> Comment at: lib/IR/PassRegistry.cpp:52<br class="">
> @@ +51,3 @@<br class="">
> +  if (needMutex)<br class="">
> +    Lock.unlock_shared();<br class="">
> +  return PI;<br class="">
> ----------------<br class="">
> It is unfortunate to lose RAII, is there a good reason why SmartScopedReader cannot take an extra parameter to be constructed without locking? (like std::unique_lock())</p><p dir="ltr" class="">(Agreed, and I provided a patch in my last reply that keeps RAII)</p><div class=""><br class=""></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">I missed the fact we have Optional in LLVM! </div><div class="">Nice workaround for the lack of optional locking in SmartScopedReader. </div><div class=""><br class=""></div><div class="">Erik, can you adopt this and update you patch?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">— </div><div class="">Mehdi</div><div class=""><br class=""></div></body></html>