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

Remove unsafe implicit conversion operators in AtomicBoolean and AtomicReference<T> #6429

Merged

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Feb 21, 2023

Changes

Fixes #6392 - we weren't using these conversion operators in a lot of places and it's better to be explicit about accessing / setting the values on these synchronized types.

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

@Aaronontheweb
Copy link
Member Author

looks like this change introduced some hard failures

/// <returns>The result of the conversion.</returns>
public static implicit operator T(AtomicReference<T> atomicReference)
{
return atomicReference.Value;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also be fine?

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

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

LGTM

@Aaronontheweb Aaronontheweb merged commit e58b041 into akkadotnet:dev Feb 22, 2023
@Aaronontheweb Aaronontheweb deleted the fix-unsafe-conversion-operators branch February 22, 2023 17:59
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.

Dangerous conversion operator in AtomicBoolean.cs
2 participants