Skip to content

Deprecate Atomic::Flag #15805

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ysbaddaden
Copy link
Contributor

@ysbaddaden ysbaddaden commented May 20, 2025

Example PR that deprecates Atomic::Flag and replaces its few usages in stdlib.

The API doesn't follow the usual definition of "test and set", and the use cases are fairly limited compared to Atomic(Bool) that is more useful, for example you control memory ordering.

Related to #15786

The API doesn't follow the usual definition of "test and set", and the
use cases are fairly limited compared to Atomic(Bool) that is much more
useful, for example you control memory ordering.
Comment on lines 461 to +462
struct Atomic::Flag
@[Deprecated("Use Atomic(Bool) instead.")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Shouldn't we deprecate the entire type instead of just its constructor?

Suggested change
struct Atomic::Flag
@[Deprecated("Use Atomic(Bool) instead.")]
@[Deprecated("Use Atomic(Bool) instead.")]
struct Atomic::Flag

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but then I don't get any warning, which is odd.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants