Get current dispatch queue?

后端 未结 11 1291
难免孤独
难免孤独 2020-12-23 16:28

I have a method which should support being called from any queue, and should expect to.

It runs some code in a background thread itself, and then uses dispatch

11条回答
  •  情歌与酒
    2020-12-23 17:01

    You do have the option of "dispatch_get_current_queue()", however the iOS 6.1 SDK defines this API with these disclaimers:

    "Recommended for debugging and logging purposes only:"

    and

    "This function is deprecated and will be removed in a future release.".

    Here's another related question with some alternatives you can consider if you want code that's future-proof.

提交回复
热议问题