-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Fix the missing builtin guards for DiscardingTaskGroup #70837
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
[Concurrency] Fix the missing builtin guards for DiscardingTaskGroup #70837
Conversation
692f294
to
f203571
Compare
// correct 'createAsyncDiscardingTaskInGroup' when available (and a recent | ||
// enough compiler is used). | ||
_ = Builtin.createAsyncTaskInGroup(flags, _group, operation) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's the right dance to do here -- the comment attempts to explain what we're doing here -- See the PR which introduced this change here: https://github.com/apple/swift/pull/70537/files#diff-9897ab704fe1b9e57499ec46e8837c683573998d299ea3cbfb64d29c4a34544aL567
So we're using what "used to work" on other platforms and old compilers, and when available, we use the "right thing".
Looks right @slavapestov @kavon ?
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, Thanks!
Luckily it got caught in testing before it causes more trouble 😅 |
The PR #70537 adjusted the way we create tasks for the discarding group by using a new builtin -- this builtin must be protected with a
#if $BuiltinCreateAsyncDiscardingTaskInGroup
as otherwise we can get issues likemodule 'Builtin' has no member named 'createAsyncDiscardingTaskInGroup'
when an old compiler without this builtin is used.FYI @kateinoigakukun @MaxDesiatov
Resolves rdar://120801949