I am very confused about the usage of dispatch_once. Below two versions of code can give the same result. What is the difference when using dispatch_once?
Version 1
static dispatch_queue_t downloadQueue;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
downloadQueue = dispatch_queue_create("temp", 0);
});
Version 2
static dispatch_queue_t downloadQueue;
downloadQueue = dispatch_queue_create("dryapp", 0);