Skip to content

Commit 73ea1f1

Browse files
authored
Merge pull request #36244 from ktoso/wip-remove-unimplemented-task
2 parents 68877f9 + 5500185 commit 73ea1f1

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

stdlib/public/Concurrency/Executor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
import Swift
1414

15-
// TODO: just a placeholder; proposal and complete types soon
16-
public protocol ExecutorRef {}
15+
// TODO: Custom Executors proposal will define these types
16+
// https://forums.swift.org/t/support-custom-executors-in-swift-concurrency/44425/38

stdlib/public/Concurrency/Task.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,9 @@ extension Task {
392392
@discardableResult
393393
public static func runDetached<T>(
394394
priority: Priority = .default,
395-
startingOn executor: ExecutorRef? = nil,
396395
operation: @concurrent @escaping () async -> T
397396
// TODO: Allow inheriting task-locals?
398397
) -> Handle<T, Never> {
399-
assert(executor == nil, "Custom executor support is not implemented yet.") // FIXME
400-
401398
// Set up the job flags for a new task.
402399
var flags = JobFlags()
403400
flags.kind = .task
@@ -448,11 +445,8 @@ extension Task {
448445
@discardableResult
449446
public static func runDetached<T, Failure>(
450447
priority: Priority = .default,
451-
startingOn executor: ExecutorRef? = nil,
452448
operation: @concurrent @escaping () async throws -> T
453449
) -> Handle<T, Failure> {
454-
assert(executor == nil, "Custom executor support is not implemented yet.") // FIXME
455-
456450
// Set up the job flags for a new task.
457451
var flags = JobFlags()
458452
flags.kind = .task
@@ -478,22 +472,6 @@ public func _runAsyncHandler(operation: @escaping () async -> ()) {
478472
)
479473
}
480474

481-
// ==== Voluntary Suspension -----------------------------------------------------
482-
483-
extension Task {
484-
485-
/// Explicitly suspend the current task, potentially giving up execution actor
486-
/// of current actor/task, allowing other tasks to execute.
487-
///
488-
/// This is not a perfect cure for starvation;
489-
/// if the task is the highest-priority task in the system, it might go
490-
/// immediately back to executing.
491-
@available(*, deprecated, message: "Not implemented yet.")
492-
public static func yield() async {
493-
fatalError("\(#function) not implemented yet.")
494-
}
495-
}
496-
497475
// ==== UnsafeCurrentTask ------------------------------------------------------
498476

499477
extension Task {

0 commit comments

Comments
 (0)