Skip to content

Instantly share code, notes, and snippets.

@steipete
Created August 3, 2018 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steipete/0b2b806018bd7acb14955f22060b50a6 to your computer and use it in GitHub Desktop.
Save steipete/0b2b806018bd7acb14955f22060b50a6 to your computer and use it in GitHub Desktop.
// Works
__auto_type queue = dispatch_queue_create("com.pspdfkit.test", DISPATCH_QUEUE_SERIAL);
dispatch_set_target_queue(queue, dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0));
// Crashes with EXC_BAD_INSTRUCTION
// I guess this fails because the global queues already have an autorelease pool?
__auto_type queue2 = dispatch_queue_create("com.pspdfkit.test", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL);
dispatch_set_target_queue(queue2, dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment