Created
May 30, 2012 18:54
-
-
Save followben/2838276 to your computer and use it in GitHub Desktop.
qt_dispatch_sync_to_main_queue - performSelector on main thread for GCD
This file contains hidden or 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
void qt_dispatch_sync_to_main_queue(dispatch_block_t aBlock) { | |
if ([NSThread isMainThread]) { | |
aBlock(); | |
} else { | |
dispatch_sync(dispatch_get_main_queue(), aBlock); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment