GCD and callbacks - concurrency issue
问题 I have a callback handler registered that listens to changes in the iOS Address Book. Due to some strange reason (for which a bug has been filed), this callback can sometimes be called more than once when the app returns from the background. I want my callback handler to run it's logic only once, even in cases the callback is called multiple times. This is how I register the callback: ABAddressBookRegisterExternalChangeCallback(address_book, adressBookChanged, self); This is how I structured