Skip to content

Instantly share code, notes, and snippets.

@liuliu
Created December 26, 2019 21:50
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 liuliu/ce1276b0d70bea28bff647c49d72335a to your computer and use it in GitHub Desktop.
Save liuliu/ce1276b0d70bea28bff647c49d72335a to your computer and use it in GitHub Desktop.
typedef void (*dispatch_f)(void*, ...);
dispatch_f dispatch_block_special_invoke()
{
static dispatch_once_t onceToken;
static dispatch_f f;
dispatch_once(&onceToken, ^{
f = (__bridge struct Block_layout *)dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, ^{})->invoke;
});
return f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment