[PATCH] Add a lock() function in PassRegistry to speed up multi-thread synchronization.

David Blaikie dblaikie at gmail.com
Fri Feb 27 08:05:16 PST 2015


On Feb 27, 2015 7:52 AM, "Mehdi AMINI" <mehdi.amini at apple.com> wrote:
>
> ================
> Comment at: lib/IR/PassRegistry.cpp:52
> @@ +51,3 @@
> +  if (needMutex)
> +    Lock.unlock_shared();
> +  return PI;
> ----------------
> 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())

(Agreed, and I provided a patch in my last reply that keeps RAII)

>
> http://reviews.llvm.org/D7787
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150227/33d795a2/attachment.html>


More information about the llvm-commits mailing list