Created
September 9, 2011 08:27
-
-
Save steipete/1205760 to your computer and use it in GitHub Desktop.
dispatch_reentrant
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
// checks if already in current queue, prevents deadlock | |
void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_block_t block) { | |
if (dispatch_get_current_queue() == queue) { | |
block(); | |
}else { | |
dispatch_sync(queue, block); | |
} | |
} |
myell0w
commented
Sep 17, 2011
via email
my exzerpt is from the documentation that comes with the latest Xcode 4.2 beta, so iOS 5 Beta 7.
sent from phone
Am 17.09.2011 um 15:09 schrieb Peter Steinbergerreply@reply.github.com:
… Where do you find this? Would be great if they changed this...
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1205760
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment