@@ -18,7 +18,7 @@ import SwiftShims
18
18
// ==== -----------------------------------------------------------------------
19
19
// MARK: Precondition executors
20
20
21
- @available ( SwiftStdlib 5 . 9 , * )
21
+ @available ( SwiftStdlib 5 . 1 , * )
22
22
extension SerialExecutor {
23
23
/// Unconditionally if the current task is executing on the expected serial executor,
24
24
/// and if not crash the program offering information about the executor mismatch.
@@ -35,7 +35,8 @@ extension SerialExecutor {
35
35
/// * In `-Ounchecked` builds, the optimizer may assume that this function is
36
36
/// never called. Failure to satisfy that assumption is a serious
37
37
/// programming error.
38
- @available ( SwiftStdlib 5 . 9 , * )
38
+ @available ( SwiftStdlib 5 . 1 , * )
39
+ @backDeployed ( before: SwiftStdlib 5.9 )
39
40
public func preconditionIsolated(
40
41
_ message: @autoclosure ( ) -> String = String ( ) ,
41
42
file: StaticString = #fileID, line: UInt = #line
@@ -54,7 +55,7 @@ extension SerialExecutor {
54
55
}
55
56
}
56
57
57
- @available ( SwiftStdlib 5 . 9 , * )
58
+ @available ( SwiftStdlib 5 . 1 , * )
58
59
extension Actor {
59
60
/// Unconditionally if the current task is executing on the serial executor of the passed in `actor`,
60
61
/// and if not crash the program offering information about the executor mismatch.
@@ -71,7 +72,8 @@ extension Actor {
71
72
/// * In `-Ounchecked` builds, the optimizer may assume that this function is
72
73
/// never called. Failure to satisfy that assumption is a serious
73
74
/// programming error.
74
- @available ( SwiftStdlib 5 . 9 , * )
75
+ @available ( SwiftStdlib 5 . 1 , * )
76
+ @backDeployed ( before: SwiftStdlib 5.9 )
75
77
public nonisolated func preconditionIsolated(
76
78
_ message: @autoclosure ( ) -> String = String ( ) ,
77
79
file: StaticString = #fileID, line: UInt = #line
@@ -90,7 +92,7 @@ extension Actor {
90
92
}
91
93
}
92
94
93
- @available ( SwiftStdlib 5 . 9 , * )
95
+ @available ( SwiftStdlib 5 . 1 , * )
94
96
extension GlobalActor {
95
97
/// Unconditionally if the current task is executing on the serial executor of the passed in `actor`,
96
98
/// and if not crash the program offering information about the executor mismatch.
@@ -107,7 +109,8 @@ extension GlobalActor {
107
109
/// * In `-Ounchecked` builds, the optimizer may assume that this function is
108
110
/// never called. Failure to satisfy that assumption is a serious
109
111
/// programming error.
110
- @available ( SwiftStdlib 5 . 9 , * )
112
+ @available ( SwiftStdlib 5 . 1 , * )
113
+ @backDeployed ( before: SwiftStdlib 5.9 )
111
114
public static func preconditionIsolated(
112
115
_ message: @autoclosure ( ) -> String = String ( ) ,
113
116
file: StaticString = #fileID, line: UInt = #line
@@ -119,7 +122,7 @@ extension GlobalActor {
119
122
// ==== -----------------------------------------------------------------------
120
123
// MARK: Assert executors
121
124
122
- @available ( SwiftStdlib 5 . 9 , * )
125
+ @available ( SwiftStdlib 5 . 1 , * )
123
126
extension SerialExecutor {
124
127
/// Performs an executor check in debug builds.
125
128
///
@@ -133,7 +136,8 @@ extension SerialExecutor {
133
136
/// * In `-Ounchecked` builds, `condition` is not evaluated, but the optimizer
134
137
/// may assume that it *always* evaluates to `true`. Failure to satisfy that
135
138
/// assumption is a serious programming error.
136
- @available ( SwiftStdlib 5 . 9 , * )
139
+ @available ( SwiftStdlib 5 . 1 , * )
140
+ @backDeployed ( before: SwiftStdlib 5.9 )
137
141
public func assertIsolated(
138
142
_ message: @autoclosure ( ) -> String = String ( ) ,
139
143
file: StaticString = #fileID, line: UInt = #line
@@ -152,7 +156,7 @@ extension SerialExecutor {
152
156
}
153
157
}
154
158
155
- @available ( SwiftStdlib 5 . 9 , * )
159
+ @available ( SwiftStdlib 5 . 1 , * )
156
160
extension Actor {
157
161
/// Performs an executor check in debug builds.
158
162
///
@@ -166,7 +170,8 @@ extension Actor {
166
170
/// * In `-Ounchecked` builds, `condition` is not evaluated, but the optimizer
167
171
/// may assume that it *always* evaluates to `true`. Failure to satisfy that
168
172
/// assumption is a serious programming error.
169
- @available ( SwiftStdlib 5 . 9 , * )
173
+ @available ( SwiftStdlib 5 . 1 , * )
174
+ @backDeployed ( before: SwiftStdlib 5.9 )
170
175
public nonisolated func assertIsolated(
171
176
_ message: @autoclosure ( ) -> String = String ( ) ,
172
177
file: StaticString = #fileID, line: UInt = #line
@@ -186,7 +191,7 @@ extension Actor {
186
191
}
187
192
}
188
193
189
- @available ( SwiftStdlib 5 . 9 , * )
194
+ @available ( SwiftStdlib 5 . 1 , * )
190
195
extension GlobalActor {
191
196
/// Performs an executor check in debug builds.
192
197
///
@@ -200,7 +205,8 @@ extension GlobalActor {
200
205
/// * In `-Ounchecked` builds, `condition` is not evaluated, but the optimizer
201
206
/// may assume that it *always* evaluates to `true`. Failure to satisfy that
202
207
/// assumption is a serious programming error.
203
- @available ( SwiftStdlib 5 . 9 , * )
208
+ @available ( SwiftStdlib 5 . 1 , * )
209
+ @backDeployed ( before: SwiftStdlib 5.9 )
204
210
public static func assertIsolated(
205
211
_ message: @autoclosure ( ) -> String = String ( ) ,
206
212
file: StaticString = #fileID, line: UInt = #line
@@ -212,7 +218,7 @@ extension GlobalActor {
212
218
// ==== -----------------------------------------------------------------------
213
219
// MARK: Assume Executor
214
220
215
- @available ( SwiftStdlib 5 . 9 , * )
221
+ @available ( SwiftStdlib 5 . 1 , * )
216
222
extension Actor {
217
223
/// A safe way to synchronously assume that the current execution context belongs to the passed in actor.
218
224
///
@@ -227,7 +233,8 @@ extension Actor {
227
233
/// if another actor uses the same serial executor--by using that actor's ``Actor/unownedExecutor``
228
234
/// as its own ``Actor/unownedExecutor``--this check will succeed, as from a concurrency safety
229
235
/// perspective, the serial executor guarantees mutual exclusion of those two actors.
230
- @available ( SwiftStdlib 5 . 9 , * )
236
+ @available ( SwiftStdlib 5 . 1 , * )
237
+ @backDeployed ( before: SwiftStdlib 5.9 )
231
238
@_unavailableFromAsync ( message: " express the closure as an explicit function declared on the specified 'actor' instead " )
232
239
public nonisolated func assumeIsolated< T> (
233
240
_ operation: ( isolated Self) throws -> T ,
@@ -253,4 +260,4 @@ extension Actor {
253
260
}
254
261
}
255
262
256
- #endif // not SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
263
+ #endif // not SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
0 commit comments