[SE-0417] Revise Task(executorPreference:) ownership semantics #2504
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is just a cleanup of a semantics section which previously showed what was unsafe, but actually isn't unsafe anymore since we fixed it.
This should not require a re-review, as it does not change API surface in any way, it's more of a bugfix really, and making the proposal match reality now.
Removed some changes since not necessary anymore
3ad8d51 is a necessary revision in order to uphold default actor isolation safety when a task executor is used. Without this change task executors could violate actor isolation and even run concurrent code on a single actor. We must address this by forwarding the serial executor to the task execution such that it can do the usual actor locking.The implementation for this change is here: [Concurrency] Fix default actor isolation issue in face of TaskExecutor preference swift#74658 and we need to decide how aggressively we can phase out the incorrect APIs.