Re: Subclassing NSControl and inheritance of target, action properties
Re: Subclassing NSControl and inheritance of target, action properties
- Subject: Re: Subclassing NSControl and inheritance of target, action properties
- From: Quincey Morris <email@hidden>
- Date: Fri, 30 Jan 2015 05:53:32 +0000
On Jan 29, 2015, at 21:16 , Ken Thomases <email@hidden> wrote:
>
> the getter has to do the equivalent of retain+autorelease atomically
I was thinking that the same would have to be true of local variable accesses, too, but I see (if I see) the difference is that references from local variables are already retained per-thread, not just per-object.
But now I don’t see how the autorelease got in there. If the getter does the retain atomically, then surely it can do the release at its leisure?
The other thing that’s getting in the way is that it seems to me that the retain-count *increment* needs to be done atomically, independently of whether the retain as a whole is atomic. Otherwise, multi-thread read-only access to a variable wouldn’t be safe outside of atomic properties.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden