I'm trying to implement a basic promise variable and I'm not sure if
OSMemoryBarrier() is enough to make it correct. If anyone is familiar
with the memory model, I'd appreciate a quick look-over.
It's basically like this:
{
BOOL done;
id result;
NSError* error;
NSException* exception;
}
Users ask for KVO notifications on 'done' and don't attempt to access
any other ivars until done == YES. Then whatever thread or NSOperation
or whatever that is responsible for delivering the result calls: