The queue on which to submit the block. This parameter cannot be NULL.
提交塊的隊(duì)列蚌斩。
此參數(shù)不能為NULL。
block
The block to be invoked on the target dispatch queue. This parameter cannot be NULL.
要在目標(biāo)調(diào)度隊(duì)列上調(diào)用的塊范嘱。
此參數(shù)不能為NULL送膳。
Discussion
Submits a block to a dispatch queue for synchronous execution. Unlike dispatch_async, this function does not return until the block has finished. Calling this function and targeting the current queue results in deadlock.
將塊提交到調(diào)度隊(duì)列以進(jìn)行同步執(zhí)行。 與dispatch_async不同丑蛤,此功能在塊完成之前不會(huì)返回叠聋。 調(diào)用此函數(shù)并以當(dāng)前隊(duì)列為目標(biāo)隊(duì)列會(huì)導(dǎo)致死鎖。
Unlike with dispatch_async, no retain is performed on the target queue. Because calls to this function are synchronous, it "borrows" the reference of the caller. Moreover, no Block_copy is performed on the block.
與dispatch_async不同盏阶,不對(duì)目標(biāo)隊(duì)列執(zhí)行持有晒奕。 因?yàn)檎{(diào)用此函數(shù)是同步的,所以它“借用”調(diào)用者的引用脑慧。 此外砰盐,不對(duì)塊執(zhí)行Block_copy闷袒。
As an optimization, this function invokes the block on the current thread when possible.
作為優(yōu)化,可能的話此函數(shù)會(huì)在當(dāng)前線程上調(diào)用塊.