Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-8542] Setting OperationQueue.name sets OperationQueue.underlyingQueue to nil #3646

Closed
swift-ci opened this issue Aug 15, 2018 · 2 comments
Assignees

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-8542
Radar None
Original Reporter morlovich (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @phausler
Priority Medium

md5: 5c53b69249fa5d38ca9db24d2a2ed252

Issue Description:

Please copy/paste this code into queue.swift file and compile:

import Foundation

let queue = DispatchQueue(label: "org.swift.queue")
let opqueue = OperationQueue()
opqueue.underlyingQueue = queue
opqueue.name = "foo"

precondition(opqueue.underlyingQueue === queue, "Should be same!")

print("PASS")

The precondition fails on Ubuntu 16.04 with Swift 4.2-CONVERGENCE build. Passes on Darwin with the same swift toolchain.

The issue seems to be here:

https://github.com/apple/swift-corelibs-foundation/blob/swift-4.2-branch/Foundation/Operation.swift

Around line 529.

This was introduced in this commit:

bc3abbf

@phausler
Copy link
Member

This isnt a 4.2 regression, NSOQ's implementation could use some sprucing up particularly in the regards to things like this.

@spevans
Copy link
Collaborator

spevans commented Jun 25, 2020

This is fixed in 5.1

$ sr-8542.swift
import Foundation
let queue = DispatchQueue(label: "org.swift.queue")
let opqueue = OperationQueue()
opqueue.underlyingQueue = queue
opqueue.name = "foo"
precondition(opqueue.underlyingQueue === queue, "Should be same!")
print("PASS")

$ ~/swift-5.1.5-RELEASE-ubuntu18.04/usr/bin/swift sr-8542.swift
PASS
 

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants