If i use
@property (atomic,assign) int value;
and then access it like that
self.value--;
is an atom of decrement. Because if I had to do this:
self.value = self.value - 1;
then Iβm sure there will be a chance of a race condition between reading and writing.
My instinct, of course, is simply to do this.
@synchronized(self) { value--; }
but they tell me that this is not a kosher.
Thanks.
user1312991
source share