在蘋果的示例代碼,AVCam-iOS: Using AVFoundation to Capture Images and Movies,我注意到這個下面一行:什麼是隊列屬性在dispatch_queue_create
// Communicate with the session and other session objects on this queue.
self.sessionQueue = dispatch_queue_create("session queue", DISPATCH_QUEUE_SERIAL);
而且我想知道第二個參數是關於什麼的,還有什麼其他選擇呢我們還有其他比DISPATCH_QUEUE_SERIAL
?
令人困惑的是,在其他Apple文檔中,它說第二個參數是保留的,應該設置爲NULL
。看來或者文檔已經過時,任何人都可以解釋第二個參數應該是什麼?
dispatch_queue_create函數有兩個參數:隊列名稱和一組隊列屬性。隊列屬性保留供將來使用,並應爲NULL。 Concurrency Programming Guide
如果指定NULL作爲第二個參數,然後一個串行隊列創建。以下是https://developer.apple.com/reference/dispatch/1453030-dispatch_queue_create的鏈接 –