Skip to content
New issue

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

LKDispatch 函数内是否应该将 dispatch_sync(queue, block) 改为 dispatch_async(queue, block) ? #39

Open
PipeDog opened this issue Apr 21, 2021 · 0 comments

Comments

@PipeDog
Copy link

PipeDog commented Apr 21, 2021

inline static void LKDispatch(BOOL sync, dispatch_queue_t _Nonnull queue, dispatch_block_t _Nonnull block)
{
if (sync)
{
block();
}
else
{
if (dispatch_queue_get_label(queue) == dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL))
{
block();
}
else
{
dispatch_sync(queue, block);
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant