Skip to content

[Executors] Fix delegation chain of Excecutor.enqueue for Job specifically #65732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2023

Conversation

ktoso
Copy link
Contributor

@ktoso ktoso commented May 6, 2023

Resolves: rdar://108788736

Since we now have THREE overloads of enqueue and must allow implementing just ONE of them, the delegation pattern must form a ring: Unowned Job -> Executor Job -> Job -> ---||--- we didn't do this and delegated to UnownedJob based on directly from ExecutorJob which would have caused an infinite cycle if only (deprecated) Job based enqueue was implemented. We issue warnings in typechecking and require that one of these methods will be implemented already, so the "cyclic delegation" is always safe -- at least one of the methods will break the cycle by having an end user implement it.

@ktoso ktoso requested review from DougGregor and hborla May 6, 2023 02:00
@ktoso
Copy link
Contributor Author

ktoso commented May 6, 2023

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit a04d273 into swiftlang:main May 6, 2023
@ktoso ktoso deleted the wip-delegation-chain-fix-executors branch May 6, 2023 10:04
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.

2 participants