File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -95,25 +95,17 @@ public protocol SchedulableExecutor: Executor {
95
95
96
96
extension Actor {
97
97
98
- /// Perform an operation with the actor's ``SerialExecutor``.
99
- ///
100
- /// This converts the actor's ``Actor/unownedExecutor`` to a ``SerialExecutor`` while
101
- /// retaining the actor for the duration of the operation. This is to ensure the lifetime
102
- /// of the executor while performing the operation.
98
+ // FIXME: SE evolution: these should be removed in favor of an 'executor' property
103
99
@_alwaysEmitIntoClient
104
100
@available ( SwiftStdlib 5 . 1 , * )
105
- public nonisolated func withSerialExecutor < T> ( _ operation: ( any SerialExecutor ) throws -> T ) rethrows -> T {
101
+ public nonisolated func _withSerialExecutor < T> ( _ operation: ( any SerialExecutor ) throws -> T ) rethrows -> T {
106
102
try operation ( unsafe unsafeBitCast( self . unownedExecutor, to: ( any SerialExecutor ) . self) )
107
103
}
108
104
109
- /// Perform an operation with the actor's ``SerialExecutor``.
110
- ///
111
- /// This converts the actor's ``Actor/unownedExecutor`` to a ``SerialExecutor`` while
112
- /// retaining the actor for the duration of the operation. This is to ensure the lifetime
113
- /// of the executor while performing the operation.
105
+ // FIXME: SE evolution: these should be removed in favor of an 'executor' property
114
106
@_alwaysEmitIntoClient
115
107
@available ( SwiftStdlib 5 . 1 , * )
116
- public nonisolated func withSerialExecutor < T> ( _ operation: ( any SerialExecutor ) async throws -> T ) async rethrows -> T {
108
+ public nonisolated func _withSerialExecutor < T> ( _ operation: ( any SerialExecutor ) async throws -> T ) async rethrows -> T {
117
109
try await operation ( unsafe unsafeBitCast( self . unownedExecutor, to: ( any SerialExecutor ) . self) )
118
110
}
119
111
}
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ actor ActorOnIsCheckImplementingExecutor<Ex: SerialExecutor> {
113
113
114
114
let anyActor : any Actor = hasIsCheckActor
115
115
116
- anyActor. withSerialExecutor { se in
116
+ anyActor. _withSerialExecutor { se in
117
117
let outside = se. isIsolatingCurrentContext ( )
118
118
assert ( outside == true ) // This is just a mock executor impl that always returns "true" (it is lying)
119
119
// CHECK: called: isIsolatingCurrentContext
You can’t perform that action at this time.
0 commit comments