We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In initWithCacheDirectory method of EGOCache.m file, the dispatch_set_target_queue's usage is not correct.
initWithCacheDirectory
EGOCache.m
dispatch_set_target_queue
- (instancetype)initWithCacheDirectory:(NSString*)cacheDirectory { if((self = [super init])) { _cacheInfoQueue = dispatch_queue_create("com.enormego.egocache.info", DISPATCH_QUEUE_SERIAL); dispatch_queue_t priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); dispatch_set_target_queue(priority, _cacheInfoQueue); _frozenCacheInfoQueue = dispatch_queue_create("com.enormego.egocache.info.frozen", DISPATCH_QUEUE_SERIAL); priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); dispatch_set_target_queue(priority, _frozenCacheInfoQueue); _diskQueue = dispatch_queue_create("com.enormego.egocache.disk", DISPATCH_QUEUE_CONCURRENT); priority = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); dispatch_set_target_queue(priority, _diskQueue);
In man page of dispatch_set_target_queue, it has below statements:
The result of passing the main queue or a global concurrent queue as the first argument of dispatch_set_target_queue() is undefined.
So the usage of dispatch_set_target_queue is not correct, the correct usage should be as below:
dispatch_set_target_queue(_cacheInfoQueue, priority); dispatch_set_target_queue(_frozenCacheInfoQueue, priority); dispatch_set_target_queue(_diskQueue, priority);
The text was updated successfully, but these errors were encountered:
Yes, I have the same question. Seems like @haifenghuang 's code is correct
Sorry, something went wrong.
No branches or pull requests
In
initWithCacheDirectory
method ofEGOCache.m
file, thedispatch_set_target_queue
's usage is not correct.In man page of
dispatch_set_target_queue
, it has below statements:So the usage of
dispatch_set_target_queue
is not correct, the correct usage should be as below:The text was updated successfully, but these errors were encountered: