Skip to content
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

Implement 'ConditionalWeakTable<TKey,TValue>.Remove' API #112263

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Sergio0694
Copy link
Contributor

Closes #111925

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

/// The key may get garbage collected during the Remove() operation. If so,
/// Remove() will not fail or throw, however, the return value can be either true or false
/// depending on who wins the race.
/// The key may get garbage collected during the <see cref="Remove(TKey)"/> operation. If so,
Copy link
Member

Choose a reason for hiding this comment

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

Unless Remove is inlined, and presumably today it can't be due to the lock resulting in a try/finally, how could the key be garbage collected during the Remove call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, this comment was there before this change. Perhaps we should ask someone from the GC team?

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

Successfully merging this pull request may close these issues.

[API Proposal]: ConditionalWeakTable<TKey,TValue>.Remove overload
2 participants