FROM : Bill Bumgarner
DATE : Sun Jan 13 20:13:49 2008
On Jan 6, 2008, at 11:32 AM, Jim Correia wrote:
> Can you offer any advice for the times when I must write my own
> accessor, but want it to have similar behaviors to the autogenerated
> accessor? In particular, I'm thinking about the default atomic
> behavior. Is this simply wrapping the work in a @synchronized(self)
> block? Something else?
Sure.
http://www.friday.com/bbum/2008/01/13/objectivce-c-atomic-properties-threading-andor-custom-settergetter/
Long and short of it, you can use @synchronized(self) to make an
accessor pair atomic.
But does that actually solve a problem you have? Probably not.
b.bum
DATE : Sun Jan 13 20:13:49 2008
On Jan 6, 2008, at 11:32 AM, Jim Correia wrote:
> Can you offer any advice for the times when I must write my own
> accessor, but want it to have similar behaviors to the autogenerated
> accessor? In particular, I'm thinking about the default atomic
> behavior. Is this simply wrapping the work in a @synchronized(self)
> block? Something else?
Sure.
http://www.friday.com/bbum/2008/01/13/objectivce-c-atomic-properties-threading-andor-custom-settergetter/
Long and short of it, you can use @synchronized(self) to make an
accessor pair atomic.
But does that actually solve a problem you have? Probably not.
b.bum






Cocoa mail archive

