[Pitch #2] SE-0371 Isolated & async deinit


I've updated previous proposal for isolated synchronous deinit, and would like to pitch it again.

The main updates are:

  • Isolation for synchronous deinit now is an opt-in using the isolated keyword.
  • Copying task-locals can be disabled for performance using new @resetTaskLocals attribute, but by default task-locals are copied.
  • Support for asynchronous deinit was added. Asynchronous deinit always executes concurrently with the code that triggered last release.

Please share any thoughts, questions or suggestions!



Thanks. Iā€™m missing this in some cases, so very welcome from me.

1 Like

+1, especially for the 'isolated deinit'. For me it's closing a gap for classes derived from UIView or UIViewController as outlined in the proposal.

1 Like

Do I understand the proposal correctly that synchronous deinit defaults to non-isolated, but asynchronous deinit defaults to isolated?


Of course, if async deinit is inside a class without isolation, then it also will be nonisolated.

As mentioned in the proposal the main reason is to discourage people from awaiting on individual properties.