Skip to content

Small fix for atomics when completing a future #62954

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
Jan 12, 2023

Conversation

kavon
Copy link
Member

@kavon kavon commented Jan 11, 2023

When a completed task updates the queue head to announce
that it's been completed, it only did an acquire exchange.

By also having it also do a release, we will ensure that
prior writes done by the completed task, before the task is
marked completed, will be correctly ordered as happening
before any subsequent reads by tasks waiting on that
completion status.

Thanks @rjmccall for spotting this issue!

When a completed task updates the queue head to announce
that it's been completed, it only did an acquire exchange.

By also having it also do a release, we will ensure that
prior writes done by the completed task, before the task is
marked completed, will be correctly ordered as happening
before any subsequent reads by tasks waiting on that
completion status.

Co-authored-by: John McCall <[email protected]>
@kavon kavon changed the title Tweak atomics Small fix for atomics when completing a future Jan 11, 2023
@kavon
Copy link
Member Author

kavon commented Jan 11, 2023

@swift-ci please smoke test and merge

@kavon kavon marked this pull request as ready for review January 11, 2023 22:16
@swift-ci swift-ci merged commit 8456a7e into swiftlang:main Jan 12, 2023
@kavon kavon deleted the tweak-atomics branch January 12, 2023 04:05
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