[PATCH] Implicitly convert C++ wrappers to ObjC objects in @synchronized.

Jordan Rose jordan_rose at apple.com
Tue Aug 12 09:30:23 PDT 2014


Fair enough, committed in r215453. Thanks, Grant!

Jordan


On Aug 9, 2014, at 17:53 , Grant Paul <grant at grantpaul.com> wrote:

> I agree completely with discouraging @synchronized, and tend to avoid it myself. The reasoning behind this patch is a discussion I was having with someone who works on code which does use @synchronized extensively, and they complained about Clang not supporting implicit conversions when using C++ wrapper objects. I don't have a strong reason to request this patch be merged, but it would be nice to be able to say that issue is fixed.
> 
> Thanks,
> 
> Grant
> 
> 
> On Tue, Aug 5, 2014 at 6:21 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> I feel obliged to advise you to switch away to @synchronized to something more efficient and more appropriate for your use case. I'm not sure it's worth improving @synchronized when it's really not a good default choice for concurrency protection.
> 
> Jordan
> 
> 
> On Aug 2, 2014, at 18:17 , Grant Paul <grant at grantpaul.com> wrote:
> 
> > Hi,
> >
> > Attached is a patch to allow implicitly converting C++ wrapper objects in @synchronized. Many projects (Chromium, MobileCydia, etc) use RAII-based handles for Objective-C objects, but are not able to use those handles in @synchronized without an explicit cast.
> >
> > Thanks,
> >
> > Grant
> > <synchronized.patch>_______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140812/ca9d9021/attachment.html>


More information about the cfe-commits mailing list