Skip to content

Commit a583630

Browse files
committed
move to nonisolated(nonsending)
1 parent 8ee8ff4 commit a583630

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

stdlib/public/Concurrency/TaskCancellation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ import Swift
7070
#if !$Embedded
7171
@backDeployed(before: SwiftStdlib 6.2)
7272
#endif
73-
@execution(caller)
73+
nonisolated(nonsending)
7474
public func withTaskCancellationHandler<T>(
75-
operation: @execution(caller) () async throws -> T,
75+
operation: nonisolated(nonsending) () async throws -> T,
7676
onCancel handler: @Sendable () -> Void
7777
) async rethrows -> T {
7878
// unconditionally add the cancellation record to the task.
@@ -85,7 +85,7 @@ public func withTaskCancellationHandler<T>(
8585

8686
// Note: Deprecated version which would still hop if we did not close over an `isolated` parameter
8787
// with the operation closure. Instead, we should do what the docs of this method promise - and not hop at all,
88-
// by using the new @execution(caller)
88+
// by using the new nonisolated(nonsending)
8989
@available(SwiftStdlib 5.1, *)
9090
//#if !$Embedded
9191
//@backDeployed(before: SwiftStdlib 6.0)

test/abi/macOS/arm64/concurrency.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ Added: _$sScf13checkIsolatedyyFTq
321321
Added: _$ss27withTaskCancellationHandler9operation8onCancel9isolationxxyYaKXE_yyYbXEScA_pSgYitYaKlF
322322
Added: _$ss27withTaskCancellationHandler9operation8onCancel9isolationxxyYaKXE_yyYbXEScA_pSgYitYaKlFTu
323323
// withTaskCancellationHandler but with caller execution
324-
// Swift.withTaskCancellationHandler<A>(operation: @execution(caller) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
325-
// async function pointer to Swift.withTaskCancellationHandler<A>(operation: @execution(caller) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
324+
// Swift.withTaskCancellationHandler<A>(operation: nonisolated(nonsending) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
325+
// async function pointer to Swift.withTaskCancellationHandler<A>(operation: nonisolated(nonsending) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
326326
Added: _$ss27withTaskCancellationHandler9operation8onCancelxxyYaKYCXE_yyYbXEtYaKlF
327327
Added: _$ss27withTaskCancellationHandler9operation8onCancelxxyYaKYCXE_yyYbXEtYaKlFTu
328328

test/abi/macOS/x86_64/concurrency.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ Added: _$sScf13checkIsolatedyyFTq
321321
Added: _$ss27withTaskCancellationHandler9operation8onCancel9isolationxxyYaKXE_yyYbXEScA_pSgYitYaKlF
322322
Added: _$ss27withTaskCancellationHandler9operation8onCancel9isolationxxyYaKXE_yyYbXEScA_pSgYitYaKlFTu
323323
// withTaskCancellationHandler but with caller execution
324-
// Swift.withTaskCancellationHandler<A>(operation: @execution(caller) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
325-
// async function pointer to Swift.withTaskCancellationHandler<A>(operation: @execution(caller) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
324+
// Swift.withTaskCancellationHandler<A>(operation: nonisolated(nonsending) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
325+
// async function pointer to Swift.withTaskCancellationHandler<A>(operation: nonisolated(nonsending) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A
326326
Added: _$ss27withTaskCancellationHandler9operation8onCancelxxyYaKYCXE_yyYbXEtYaKlF
327327
Added: _$ss27withTaskCancellationHandler9operation8onCancelxxyYaKYCXE_yyYbXEtYaKlFTu
328328

test/api-digester/stability-concurrency-abi.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Func withTaskGroup(of:returning:body:) has mangled name changing from '_Concurre
126126

127127
// withTaskCancellationHandler now uses caller execution
128128
// Old methods are kept for ABI compatibility but this test does not understand that
129-
Func withTaskCancellationHandler(operation:onCancel:) has mangled name changing from '_Concurrency.withTaskCancellationHandler<A>(operation: () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A' to '_Concurrency.withTaskCancellationHandler<A>(operation: @execution(caller) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A'
129+
Func withTaskCancellationHandler(operation:onCancel:) has mangled name changing from '_Concurrency.withTaskCancellationHandler<A>(operation: () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A' to '_Concurrency.withTaskCancellationHandler<A>(operation: nonisolated(nonsending) () async throws -> A, onCancel: @Sendable () -> ()) async throws -> A'
130130
Func withTaskCancellationHandler(operation:onCancel:) is now with @execution
131131

132132
// *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)

0 commit comments

Comments
 (0)