Created
November 3, 2017 07:42
-
-
Save wuchuwuyou/b3508ba876ed5c970525779624c35ac6 to your computer and use it in GitHub Desktop.
dispath_queue_t
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
static dispatch_queue_t get_queue() { | |
static dispatch_queue_t queue; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
dispatch_queue_attr_t attr = DISPATCH_QUEUE_SERIAL; | |
if (NSFoundationVersionNumber >= NSFoundationVersionNumber_With_QoS_Available) { | |
attr = dispatch_queue_attr_make_with_qos_class(attr, QOS_CLASS_BACKGROUND, 0); | |
} | |
queue = dispatch_queue_create("xxxx.yyy.zzz", attr); | |
}); | |
return queue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment