You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Swift 3, setting the target queue of an existing dispatch queue fails in the Simulator for iOS and tvOS. It does not fail on macOS. (watchOS not tested, and not tested on actual devices).
This did not fail with Swift 2.2.
The code below shows the issue:
letqueue = DispatchQueue(label: "queue", attributes: DispatchQueueAttributes.serial)
letsyncQueue = DispatchQueue(label: "sync_queue", attributes: DispatchQueueAttributes.serial)
queue.setTarget(queue: syncQueue) // EXC_BAD_INSTRUCTION. Error: "Cannot change the target of this queue after it has been activated"
The text was updated successfully, but these errors were encountered:
FWIW DispatchQueue.init() uses dispatch_queue_create_with_target() from the C interface, which documents this behavior extensively (in <dispatch/queue.h>). New APIs in Dispatch already enforce this behavior, and the Swift3 overlay is such a New API Surface.