Skip to content

Conversation

@DougGregor
Copy link
Member

  • Explanation: When targeting a platform that predates the introduction of isolated deinit (SE-0371), make a narrow exception that allows main-actor-isolated deinit to work through a special, inlineable entrypoint that is back-deployed.
  • Scope: Narrow. Only active when using a new feature (isolated deinit) and deploying prior to its introduction (Spring 2025).
  • Issues: rdar://151029118
  • Original PRs: [SE-0371] Back-deploy support for main-actor-isolated deinit #82661
  • Risk: Low. Changes are limited to code paths for the new feature. code paths.
  • Testing: CI
  • Reviewers:

When targeting a platform that predates the introduction of isolated
deinit, make a narrow exception that allows main-actor-isolated deinit
to work through a special, inlineable entrypoint that is
back-deployed. This implementation

  1. Calls into the real implementation when available, otherwise
  2. Checks if we're on the main thread, destroying immediately when
we are, otherwise
  3. Creates a new task on the main actor to handle destruction.

This implementation is less efficient than the implementation in the
runtime, but allows us to back-deploy this functionality as far back
as concurrency goes.

Fixes rdar://151029118.
@DougGregor DougGregor requested a review from a team as a code owner July 1, 2025 00:42
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor changed the title [SE-0371] Back-deploy support for main-actor-isolated deinit [6.2] [SE-0371] Back-deploy support for main-actor-isolated deinit Jul 1, 2025
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge July 1, 2025 23:06
@DougGregor DougGregor merged commit 7d10f95 into swiftlang:release/6.2 Jul 2, 2025
5 checks passed
@DougGregor DougGregor deleted the back-deploy-main-actor-isolated-deinit-6.2 branch July 2, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants