Skip to content

Instantly share code, notes, and snippets.

@larryaasen
Last active December 14, 2015 14:59
Show Gist options
  • Save larryaasen/5104501 to your computer and use it in GitHub Desktop.
Save larryaasen/5104501 to your computer and use it in GitHub Desktop.
A simple C function to submit a block for asynchronous execution on the main queue (main thread).
void dispatch_async_on_main_queue(dispatch_block_t block);
/*
* Submits a block for asynchronous execution on the main queue (main thread).
*/
void dispatch_async_on_main_queue(dispatch_block_t block)
{
dispatch_async(dispatch_get_main_queue(), block);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment