Skip to content

Commit 8e64083

Browse files
authored
Merge pull request #263 from dagronf/bugfix/hang-issue-catalina-multithread-issues
Reverted the multithreading improvements (Catalina bug 262)
2 parents 669bad5 + ab4f973 commit 8e64083

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Framework/src/RemoteData.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
import Foundation
99

10-
// Limit the number of simultaneous downloads
11-
private let RemoteDownloadLimiter = DispatchSemaphore(value: 10)
12-
1310
// A URLSession that caches its results
1411
private let RemoteLoadSession: URLSession = {
1512
// Create URL Session Configuration
@@ -28,6 +25,8 @@ private let RemoteLoadSession: URLSession = {
2825
}()
2926

3027
@objc public class RemoteData : NSObject {
28+
private static let queue = DispatchQueue(label: "io.metaz.RemoteDataQueue")
29+
3130
public let url : URL
3231
public let expectedMimeType : String
3332

@@ -110,11 +109,7 @@ private let RemoteLoadSession: URLSession = {
110109
let url = self.data!.url
111110
let expectedMimeType = self.data!.expectedMimeType
112111

113-
DispatchQueue.global(qos: .utility).async {
114-
RemoteDownloadLimiter.wait()
115-
defer {
116-
RemoteDownloadLimiter.signal()
117-
}
112+
RemoteData.queue.async {
118113

119114
var downloadData : Data?, responseError : NSError?
120115
let signal = DispatchSemaphore(value: 0)

0 commit comments

Comments
 (0)