File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/FoundationNetworking/URLSession Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,8 @@ open class URLSession : NSObject {
217217 return URLSession ( configuration: configuration, delegate: nil , delegateQueue: nil )
218218 } ( )
219219
220+ private static let sharedQueue = DispatchQueue ( label: " org.swift.URLSession.SharedQueue " )
221+
220222 /*
221223 * Customization of URLSession occurs during creation of a new session.
222224 * If you only need to use the convenience routines with custom
@@ -227,7 +229,7 @@ open class URLSession : NSObject {
227229 public /*not inherited*/ init ( configuration: URLSessionConfiguration ) {
228230 initializeLibcurl ( )
229231 identifier = nextSessionIdentifier ( )
230- self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " )
232+ self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " , target : Self . sharedQueue )
231233 self . delegateQueue = OperationQueue ( )
232234 self . delegateQueue. maxConcurrentOperationCount = 1
233235 self . delegate = nil
@@ -249,7 +251,7 @@ open class URLSession : NSObject {
249251 public /*not inherited*/ init ( configuration: URLSessionConfiguration , delegate: URLSessionDelegate ? , delegateQueue queue: OperationQueue ? ) {
250252 initializeLibcurl ( )
251253 identifier = nextSessionIdentifier ( )
252- self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " )
254+ self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " , target : Self . sharedQueue )
253255 if let _queue = queue {
254256 self . delegateQueue = _queue
255257 } else {
You can’t perform that action at this time.
0 commit comments