KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If I use @property (atomic,assign) int value; and later access it like so self.value--; is that decrement atomic? Because if I had to do this: self.value = self.value - 1; then I am sure there would be a chance of a race condition between the read and the write. My instinct of course is to just do this @synchronized(self) { value--; } but I am being told that is not kosher. Thanks.
Tags (comma-separated)
Save Edits
Cancel