Why dispatch_sync( ) call on main queue is blocking the main queue?

前端 未结 5 2092
花落未央
花落未央 2020-12-19 11:17

I know this is not a strong question but I have to clear my mind on this concept.

I have defined myBlock as follows.

void(^myBlock)(v         


        
5条回答
  •  独厮守ぢ
    2020-12-19 12:02

    Just need to understand this:

    dispatch_sync() blocks the dispatch queue, submit the block to it and waits until the submitted block completes.

    dispatch_async() submits the block for asynchronous execution on dispatch queue and returns immediately.

提交回复
热议问题