Skip to content

Commit

Permalink
Merge pull request #263 from dagronf/bugfix/hang-issue-catalina-multi…
Browse files Browse the repository at this point in the history
…thread-issues

Reverted the multithreading improvements (Catalina bug 262)
  • Loading branch information
griff committed Apr 26, 2022
2 parents 669bad5 + ab4f973 commit 8e64083
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Framework/src/RemoteData.swift
Expand Up @@ -7,9 +7,6 @@

import Foundation

// Limit the number of simultaneous downloads
private let RemoteDownloadLimiter = DispatchSemaphore(value: 10)

// A URLSession that caches its results
private let RemoteLoadSession: URLSession = {
// Create URL Session Configuration
Expand All @@ -28,6 +25,8 @@ private let RemoteLoadSession: URLSession = {
}()

@objc public class RemoteData : NSObject {
private static let queue = DispatchQueue(label: "io.metaz.RemoteDataQueue")

public let url : URL
public let expectedMimeType : String

Expand Down Expand Up @@ -110,11 +109,7 @@ private let RemoteLoadSession: URLSession = {
let url = self.data!.url
let expectedMimeType = self.data!.expectedMimeType

DispatchQueue.global(qos: .utility).async {
RemoteDownloadLimiter.wait()
defer {
RemoteDownloadLimiter.signal()
}
RemoteData.queue.async {

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

0 comments on commit 8e64083

Please sign in to comment.