Browse Source

Add @unchecked Sendable for concurrency.

Jon Shier 4 years ago
parent
commit
f29333cca6

+ 1 - 1
Alamofire.xcodeproj/project.pbxproj

@@ -1203,7 +1203,7 @@
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
 				LastSwiftUpdateCheck = 1250;
 				LastSwiftUpdateCheck = 1250;
-				LastUpgradeCheck = 1320;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = Alamofire;
 				ORGANIZATIONNAME = Alamofire;
 				TargetAttributes = {
 				TargetAttributes = {
 					31293064263E17D600473CEA = {
 					31293064263E17D600473CEA = {

+ 1 - 1
Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"

+ 1 - 1
Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire macOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"

+ 1 - 1
Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"

+ 1 - 1
Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"

+ 1 - 1
Example/iOS Example.xcodeproj/project.pbxproj

@@ -216,7 +216,7 @@
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
 				LastSwiftUpdateCheck = 0720;
 				LastSwiftUpdateCheck = 0720;
-				LastUpgradeCheck = 1320;
+				LastUpgradeCheck = 1330;
 				ORGANIZATIONNAME = Alamofire;
 				ORGANIZATIONNAME = Alamofire;
 				TargetAttributes = {
 				TargetAttributes = {
 					F8111E0419A951050040E7D1 = {
 					F8111E0419A951050040E7D1 = {

+ 1 - 1
Example/iOS Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"

+ 4 - 4
Source/Concurrency.swift

@@ -29,7 +29,7 @@ import Foundation
 // MARK: - Request Event Streams
 // MARK: - Request Event Streams
 
 
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
-extension Request {
+extension Request: @unchecked Sendable {
     /// Creates a `StreamOf<Progress>` for the instance's upload progress.
     /// Creates a `StreamOf<Progress>` for the instance's upload progress.
     ///
     ///
     /// - Parameter bufferingPolicy: `BufferingPolicy` that determines the stream's buffering behavior.`.unbounded` by default.
     /// - Parameter bufferingPolicy: `BufferingPolicy` that determines the stream's buffering behavior.`.unbounded` by default.
@@ -112,7 +112,7 @@ extension Request {
 
 
 /// Value used to `await` a `DataResponse` and associated values.
 /// Value used to `await` a `DataResponse` and associated values.
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
-public struct DataTask<Value> {
+public struct DataTask<Value>: @unchecked Sendable {
     /// `DataResponse` produced by the `DataRequest` and its response handler.
     /// `DataResponse` produced by the `DataRequest` and its response handler.
     public var response: DataResponse<Value, AFError> {
     public var response: DataResponse<Value, AFError> {
         get async {
         get async {
@@ -305,7 +305,7 @@ extension DataRequest {
 
 
 /// Value used to `await` a `DownloadResponse` and associated values.
 /// Value used to `await` a `DownloadResponse` and associated values.
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
-public struct DownloadTask<Value> {
+public struct DownloadTask<Value>: @unchecked Sendable {
     /// `DownloadResponse` produced by the `DownloadRequest` and its response handler.
     /// `DownloadResponse` produced by the `DownloadRequest` and its response handler.
     public var response: DownloadResponse<Value, AFError> {
     public var response: DownloadResponse<Value, AFError> {
         get async {
         get async {
@@ -507,7 +507,7 @@ extension DownloadRequest {
 // MARK: - DataStreamTask
 // MARK: - DataStreamTask
 
 
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
 @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
-public struct DataStreamTask {
+public struct DataStreamTask: @unchecked Sendable {
     // Type of created streams.
     // Type of created streams.
     public typealias Stream<Success, Failure: Error> = StreamOf<DataStreamRequest.Stream<Success, Failure>>
     public typealias Stream<Success, Failure: Error> = StreamOf<DataStreamRequest.Stream<Success, Failure>>
 
 

+ 1 - 1
watchOS Example/watchOS Example.xcodeproj/xcshareddata/xcschemes/watchOS Example WatchKit App.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "1320"
+   LastUpgradeVersion = "1330"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"