[swift-corelibs-dev] [libdispatch] DISPATCH_QUEUE_SERIAL & DISPATCH_QUEUE_CONCURRENT

David P Grove groved at us.ibm.com
Tue Jan 19 07:38:36 CST 2016



> From: Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev at swift.org>
>
> I’m trying to use libdispatch from Swift, but something is off with
> DISPATCH_QUEUE_SERIAL & DISPATCH_QUEUE_CONCURRENT:
>
>
> func test() {
>     let queueA = dispatch_queue_create("a", DISPATCH_QUEUE_SERIAL)
>     let queueB = dispatch_queue_create("b", DISPATCH_QUEUE_CONCURRENT)
> }
>
>
>
> Dispatch.swift:81:45: error: cannot convert value of type '()' to
> expected argument type 'dispatch_queue_attr_t' (aka 'COpaquePointer')
>     let queueA = dispatch_queue_create("a", DISPATCH_QUEUE_SERIAL)
>                                             ^~~~~~~~~~~~~~~~~~~~~
> Dispatch.swift:82:45: error: use of unresolved identifier
> 'DISPATCH_QUEUE_CONCURRENT'
>     let queueB = dispatch_queue_create("b", DISPATCH_QUEUE_CONCURRENT)
>                                             ^~~~~~~~~~~~~~~~~~~~~~~~~

Hi,

	I believe the issue is that the definition of DISPATCH_QUEUE_SERIAL
and DISPATCH_QUEUE_CONCURRENT can't be processed by the Swift importer.

	There's a pull request that updates the Dispatch overlay (
https://github.com/apple/swift/pull/974) that we've been using to work
around this.  It is working around https://bugs.swift.org/browse/SR-141

--dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-corelibs-dev/attachments/20160119/ef1465e3/attachment.html>


More information about the swift-corelibs-dev mailing list