[swift-corelibs-dev] NSOperationQueue and friends

Philippe Hausler phausler at apple.com
Mon Mar 28 15:17:29 CDT 2016


DEPLOYMENT_ENABLE_LIBDISPATCH should not be enabled unless you specifically enable it (this is until we get libdispatch fully integrated into the build system)

> On Mar 28, 2016, at 1:14 PM, Daniel Eggert <danieleggert at me.com> wrote:
> 
> This is on OS X will everything pulled from master yesterday. I'm using Xcode, and I built a toolchain from source. Same happens with the 2016-03-24 toolchain from swift.org.
> 
> For some reason DEPLOYMENT_ENABLE_LIBDISPATCH isn't set, but I guess it should be?
> 
> /Daniel
> 
> 
>> On 26 Mar 2016, at 22:54, Philippe Hausler <phausler at apple.com> wrote:
>> 
>> Is that on Linux? Perhaps it is because it is missing run loop interaction?
>> 
>> Sent from my iPhone
>> 
>> On Mar 26, 2016, at 10:52 AM, Daniel Eggert <danieleggert at me.com> wrote:
>> 
>>>> 
>>>> On 25 Mar 2016, at 21:15, Philippe Hausler via swift-corelibs-dev <swift-corelibs-dev at swift.org> wrote:
>>>> 
>>>> I know a few of you have been waiting for this: I just pushed an initial implementation of NSOperationQueue, NSOperation and NSBlockOperation. It is worth noting that this implementaiton has a few behavioral differences between this implementation and the one implemented in objective-c. Part of this difference is due to features like QoS not being cross platform portable or KVO not yet implementable in Swift. This is very much a work-in-progress; it needs unit tests and and a bit more polish, but hopefully it is good enough to get some work started in some other places.
>>>> 
>>>> - Philippe Hausler
>>> 
>>> 
>>> Great to see progress on this.
>>> 
>>> It does fail this simple test case, though:
>>> 
>>> 
>>>  func test_BlockBasedAPI() {
>>>      let queue = NSOperationQueue()
>>> 
>>>      let expectation = expectationWithDescription("did run block")
>>>      queue.addOperationWithBlock {
>>>          expectation.fulfill()
>>>      }
>>> 
>>>      waitForExpectationsWithTimeout(0.001, handler: nil)
>>>  }
>>> 
>>> I'm not sure what's going on there. I was using this on my branch for NSURLSession since it has a delegate queue that I need to run callbacks on.
>>> 
>>> /Daniel
>>> 
> 



More information about the swift-corelibs-dev mailing list