File tree 1 file changed +4
-2
lines changed
Sources/FoundationNetworking/URLSession
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 {
217
217
return URLSession ( configuration: configuration, delegate: nil , delegateQueue: nil )
218
218
} ( )
219
219
220
+ private static let sharedQueue = DispatchQueue ( label: " org.swift.URLSession.SharedQueue " )
221
+
220
222
/*
221
223
* Customization of URLSession occurs during creation of a new session.
222
224
* If you only need to use the convenience routines with custom
@@ -227,7 +229,7 @@ open class URLSession : NSObject {
227
229
public /*not inherited*/ init ( configuration: URLSessionConfiguration ) {
228
230
initializeLibcurl ( )
229
231
identifier = nextSessionIdentifier ( )
230
- self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " )
232
+ self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " , target : Self . sharedQueue )
231
233
self . delegateQueue = OperationQueue ( )
232
234
self . delegateQueue. maxConcurrentOperationCount = 1
233
235
self . delegate = nil
@@ -249,7 +251,7 @@ open class URLSession : NSObject {
249
251
public /*not inherited*/ init ( configuration: URLSessionConfiguration , delegate: URLSessionDelegate ? , delegateQueue queue: OperationQueue ? ) {
250
252
initializeLibcurl ( )
251
253
identifier = nextSessionIdentifier ( )
252
- self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " )
254
+ self . workQueue = DispatchQueue ( label: " URLSession< \( identifier) > " , target : Self . sharedQueue )
253
255
if let _queue = queue {
254
256
self . delegateQueue = _queue
255
257
} else {
You can’t perform that action at this time.
0 commit comments