Skip to content

Commit 447b90e

Browse files
committed
move to some TaskExecutor now that we can avoid the optional
1 parent 7a96011 commit 447b90e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

stdlib/public/Concurrency/Task+TaskExecutor.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ import Swift
8181
@available(SwiftStdlib 9999, *)
8282
@_unsafeInheritExecutor // calling withTaskExecutor MUST NOT perform the "usual" hop to global
8383
public func _withTaskExecutor<T: Sendable>(
84-
_ taskExecutorPreference: any _TaskExecutor,
84+
_ taskExecutorPreference: some _TaskExecutor,
8585
operation: @Sendable () async throws -> T
8686
) async rethrows -> T {
8787
let taskExecutorBuiltin: Builtin.Executor =
@@ -173,7 +173,7 @@ extension Task where Failure == Never {
173173
@discardableResult
174174
@_alwaysEmitIntoClient
175175
public init(
176-
_on executor: any _TaskExecutor,
176+
_on executor: some _TaskExecutor,
177177
priority: TaskPriority? = nil,
178178
operation: __owned @Sendable @escaping () async -> Success
179179
) {
@@ -201,7 +201,7 @@ extension Task where Failure == Error {
201201
@discardableResult
202202
@_alwaysEmitIntoClient
203203
public init(
204-
_on executor: any _TaskExecutor,
204+
_on executor: some _TaskExecutor,
205205
priority: TaskPriority? = nil,
206206
operation: __owned @Sendable @escaping () async throws -> Success
207207
) {
@@ -233,7 +233,7 @@ extension Task where Failure == Never {
233233
@_alwaysEmitIntoClient
234234
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
235235
public static func _detached(
236-
on executor: any _TaskExecutor,
236+
on executor: some _TaskExecutor,
237237
priority: TaskPriority? = nil,
238238
operation: __owned @Sendable @escaping () async -> Success
239239
) -> Task<Success, Failure> {
@@ -264,7 +264,7 @@ extension Task where Failure == Never {
264264
@discardableResult
265265
@_alwaysEmitIntoClient
266266
public static func _detached(
267-
on executor: any _TaskExecutor,
267+
on executor: some _TaskExecutor,
268268
priority: TaskPriority? = nil,
269269
operation: __owned @Sendable @escaping () async -> Success
270270
) -> Task<Success, Failure> {
@@ -296,7 +296,7 @@ extension Task where Failure == Error {
296296
@_alwaysEmitIntoClient
297297
@available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
298298
public static func _detached(
299-
on executor: any _TaskExecutor,
299+
on executor: some _TaskExecutor,
300300
priority: TaskPriority? = nil,
301301
operation: __owned @Sendable @escaping () async throws -> Success
302302
) -> Task<Success, Failure> {
@@ -329,7 +329,7 @@ extension Task where Failure == Error {
329329
@discardableResult
330330
@_alwaysEmitIntoClient
331331
public static func _detached(
332-
on executor: any _TaskExecutor,
332+
on executor: some _TaskExecutor,
333333
priority: TaskPriority? = nil,
334334
operation: __owned @Sendable @escaping () async throws -> Success
335335
) -> Task<Success, Failure> {

stdlib/public/Concurrency/TaskGroup+TaskExecutor.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extension TaskGroup {
3333
/// - operation: The operation to execute as part of the task group.
3434
@_alwaysEmitIntoClient
3535
public mutating func _addTask(
36-
on taskExecutorPreference: any _TaskExecutor,
36+
on taskExecutorPreference: some _TaskExecutor,
3737
priority: TaskPriority? = nil,
3838
operation: __owned @Sendable @escaping () async -> ChildTaskResult
3939
) {
@@ -70,7 +70,7 @@ extension TaskGroup {
7070
/// otherwise `false`.
7171
@_alwaysEmitIntoClient
7272
public mutating func _addTaskUnlessCancelled(
73-
on taskExecutorPreference: any _TaskExecutor,
73+
on taskExecutorPreference: some _TaskExecutor,
7474
priority: TaskPriority? = nil,
7575
operation: __owned @Sendable @escaping () async -> ChildTaskResult
7676
) -> Bool {
@@ -118,7 +118,7 @@ extension ThrowingTaskGroup {
118118
/// - operation: The operation to execute as part of the task group.
119119
@_alwaysEmitIntoClient
120120
public mutating func _addTask(
121-
on taskExecutorPreference: any _TaskExecutor,
121+
on taskExecutorPreference: some _TaskExecutor,
122122
priority: TaskPriority? = nil,
123123
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
124124
) {
@@ -155,7 +155,7 @@ extension ThrowingTaskGroup {
155155
/// otherwise `false`.
156156
@_alwaysEmitIntoClient
157157
public mutating func _addTaskUnlessCancelled(
158-
on taskExecutorPreference: any _TaskExecutor,
158+
on taskExecutorPreference: some _TaskExecutor,
159159
priority: TaskPriority? = nil,
160160
operation: __owned @Sendable @escaping () async throws -> ChildTaskResult
161161
) -> Bool {
@@ -203,7 +203,7 @@ extension DiscardingTaskGroup {
203203
/// - operation: The operation to execute as part of the task group.
204204
@_alwaysEmitIntoClient
205205
public mutating func _addTask(
206-
on taskExecutorPreference: any _TaskExecutor,
206+
on taskExecutorPreference: some _TaskExecutor,
207207
priority: TaskPriority? = nil,
208208
operation: __owned @Sendable @escaping () async throws -> Void
209209
) {
@@ -241,7 +241,7 @@ extension DiscardingTaskGroup {
241241
/// otherwise `false`.
242242
@_alwaysEmitIntoClient
243243
public mutating func _addTaskUnlessCancelled(
244-
on taskExecutorPreference: any _TaskExecutor,
244+
on taskExecutorPreference: some _TaskExecutor,
245245
priority: TaskPriority? = nil,
246246
operation: __owned @Sendable @escaping () async -> Void
247247
) -> Bool {
@@ -289,7 +289,7 @@ extension ThrowingDiscardingTaskGroup {
289289
/// - operation: The operation to execute as part of the task group.
290290
@_alwaysEmitIntoClient
291291
public mutating func _addTask(
292-
on taskExecutorPreference: any _TaskExecutor,
292+
on taskExecutorPreference: some _TaskExecutor,
293293
priority: TaskPriority? = nil,
294294
operation: __owned @Sendable @escaping () async throws -> Void
295295
) {
@@ -327,7 +327,7 @@ extension ThrowingDiscardingTaskGroup {
327327
/// otherwise `false`.
328328
@_alwaysEmitIntoClient
329329
public mutating func _addTaskUnlessCancelled(
330-
on taskExecutorPreference: any _TaskExecutor,
330+
on taskExecutorPreference: some _TaskExecutor,
331331
priority: TaskPriority? = nil,
332332
operation: __owned @Sendable @escaping () async throws -> Void
333333
) -> Bool {

0 commit comments

Comments
 (0)