Created
April 4, 2013 15:06
-
-
Save demigod19892012/5311169 to your computer and use it in GitHub Desktop.
[IOS] Use dispatch_once within 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
dispatch_queue_t get_my_background_queue() | |
{ | |
static dispatch_once_t once; | |
static dispatch_queue_t my_queue; | |
dispatch_once(&once, ^{ | |
my_queue = dispatch_queue_create("com.example.background", NULL); | |
}); | |
return my_queue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment