-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Synchronize adding a child task to a TaskGroup with parent task #40520
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
Synchronize adding a child task to a TaskGroup with parent task #40520
Conversation
when a task is adding adding new children to a task group, we need to synchronize with the task status record lock of the parent task that has the task group, to prevent races with concurrent cancellation and escalation. Radar-Id: rdar://problem/86311782
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.
LGTM
Resolves rdar://86311782 |
@swift-ci please smoke test |
stdlib/public/CompatibilityOverride/CompatibilityOverrideConcurrency.def
Show resolved
Hide resolved
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.
LGTM, thanks for spotting this!
Feel free to merge once CI passes, removing the double-log can be done any time.
Failure was the unrelated
from swiftpm that we fixed; rebuilding |
@swift-ci please smoke test |
Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
@swift-ci please smoke test |
rdar://86311782 |
When a task is adding adding new children to a task group, we need to synchronize with the task status record lock of the parent task that has the task group, to prevent races with concurrent cancellation and escalation.
In the future, we'd probably want a lock for the TaskGroup itself and not have it be the group's parent task's status record lock but for now, this will get us the right functionality.
rdar://86311782