Skip to content

Commit 262f07a

Browse files
committed
[Concurrency] Don't expose Dispatch or CF executors directly.
Also add `final` to the `CooperativeExecutor` declaration.
1 parent 658cf60 commit 262f07a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

stdlib/public/Concurrency/CFExecutor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ enum CoreFoundation {
4545

4646
/// A CFRunLoop-based main executor (Apple platforms only)
4747
@available(StdlibDeploymentTarget 6.2, *)
48-
public final class CFMainExecutor: DispatchMainExecutor, @unchecked Sendable {
48+
final class CFMainExecutor: DispatchMainExecutor, @unchecked Sendable {
4949

5050
override public func run() throws {
5151
CoreFoundation.CFRunLoopRun()
@@ -61,8 +61,8 @@ public final class CFMainExecutor: DispatchMainExecutor, @unchecked Sendable {
6161

6262
/// A `TaskExecutor` to match `CFMainExecutor` (Apple platforms only)
6363
@available(StdlibDeploymentTarget 6.2, *)
64-
public final class CFTaskExecutor: DispatchGlobalTaskExecutor,
65-
@unchecked Sendable {
64+
final class CFTaskExecutor: DispatchGlobalTaskExecutor,
65+
@unchecked Sendable {
6666

6767
}
6868

stdlib/public/Concurrency/CooperativeExecutor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extension ExecutorJob {
100100
/// A co-operative executor that can be used as the main executor or as a
101101
/// task executor.
102102
@available(StdlibDeploymentTarget 6.2, *)
103-
class CooperativeExecutor: Executor, @unchecked Sendable {
103+
final class CooperativeExecutor: Executor, @unchecked Sendable {
104104
var runQueue: PriorityQueue<UnownedJob>
105105
#if !$Embedded && !SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
106106
var waitQueue: PriorityQueue<UnownedJob>

stdlib/public/Concurrency/DispatchExecutor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import Swift
2525

2626
/// A Dispatch-based main executor.
2727
@available(StdlibDeploymentTarget 6.2, *)
28-
public class DispatchMainExecutor: RunLoopExecutor, SchedulingExecutor,
29-
@unchecked Sendable {
28+
class DispatchMainExecutor: RunLoopExecutor, SchedulingExecutor,
29+
@unchecked Sendable {
3030
var threaded = false
3131

3232
public init() {}
@@ -78,8 +78,8 @@ extension DispatchMainExecutor: MainExecutor {}
7878

7979
/// A Dispatch-based `TaskExecutor`
8080
@available(StdlibDeploymentTarget 6.2, *)
81-
public class DispatchGlobalTaskExecutor: TaskExecutor, SchedulingExecutor,
82-
@unchecked Sendable {
81+
class DispatchGlobalTaskExecutor: TaskExecutor, SchedulingExecutor,
82+
@unchecked Sendable {
8383
public init() {}
8484

8585
public func enqueue(_ job: consuming ExecutorJob) {

0 commit comments

Comments
 (0)