DispatchQueue crashing with main.sync in Swift

前端 未结 3 630
轻奢々
轻奢々 2020-12-16 03:43

Please explain to me why I am getting this crash?

Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

in this

3条回答
  •  悲&欢浪女
    2020-12-16 04:19

    As per Apple documentation on executing dispatch_sync on a queue you're currently on will crash your code:

    Calling this function and targeting the current queue results in deadlock.

提交回复
热议问题