mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These were right when they were written, but they are now causing trouble. Move them to 6.3.
64 lines
1.9 KiB
Swift
64 lines
1.9 KiB
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import Swift
|
|
|
|
// .. Main Executor ............................................................
|
|
|
|
@available(StdlibDeploymentTarget 6.3, *)
|
|
public final class UnimplementedMainExecutor: MainExecutor, @unchecked Sendable {
|
|
public init() {}
|
|
|
|
public func run() throws {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
|
|
public func stop() {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
|
|
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
|
|
public func enqueue(_ job: UnownedJob) {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
#else
|
|
public func enqueue(_ job: consuming ExecutorJob) {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
#endif
|
|
|
|
public var isMainExecutor: Bool { true }
|
|
|
|
public func checkIsolated() {
|
|
// Do nothing
|
|
}
|
|
}
|
|
|
|
// .. Task Executor ............................................................
|
|
|
|
@available(StdlibDeploymentTarget 6.3, *)
|
|
public final class UnimplementedTaskExecutor: TaskExecutor, @unchecked Sendable {
|
|
public init() {}
|
|
|
|
#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
|
|
public func enqueue(_ job: UnownedJob) {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
#else
|
|
public func enqueue(_ job: consuming ExecutorJob) {
|
|
fatalError("There is no executor implementation active")
|
|
}
|
|
#endif
|
|
|
|
public var isMainExecutor: Bool { false }
|
|
}
|