Skip to content

Instantly share code, notes, and snippets.

@fjolnir fjolnir/ Secret
Created Dec 11, 2013

What would you like to do?
- (void)setFoo:(id)aFoo
id old = _foo;
if(OSAtomicCompareAndSwapPtr(old, aFoo, &_foo)) {
[aFoo retain];
[old release];
[self setFoo:aFoo];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.