Created
December 10, 2014 11:24
-
-
Save OdNairy/e608d10e0f02f7505958 to your computer and use it in GitHub Desktop.
The real difference between atomic/nonatomic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!atomic) { | |
oldValue = *slot; | |
*slot = newValue; | |
} else { | |
spin_lock_t *slotlock = &PropertyLocks[GOODHASH(slot)]; | |
_spin_lock(slotlock); | |
oldValue = *slot; | |
*slot = newValue; | |
_spin_unlock(slotlock); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment