Skip to content

Harden events against race conditions#5722

Merged
singhashish-wpf merged 2 commits intodotnet:mainfrom
brunom:patch-1
Jul 21, 2022
Merged

Harden events against race conditions#5722
singhashish-wpf merged 2 commits intodotnet:mainfrom
brunom:patch-1

Conversation

@brunom
Copy link
Contributor

@brunom brunom commented Nov 21, 2021

No description provided.

@brunom brunom requested a review from a team as a code owner November 21, 2021 03:51
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Nov 21, 2021
@ghost ghost requested review from fabiant3 and ryalanms November 21, 2021 03:51
@dnfadmin
Copy link

dnfadmin commented Nov 21, 2021

CLA assistant check
All CLA requirements met.

@ghost ghost requested a review from SamBent November 21, 2021 03:51
{
CommittingBatch(Channel, new EventArgs());
}
CommittingBatch?.Invoke(Channel, new EventArgs());
Copy link
Contributor

Choose a reason for hiding this comment

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

This is more of a style change, I don't think this does anything for race conditions. It generates the same code with a manual null check or a compiler-generated null check: https://sharplab.io/#v2:D4AQTAjAsAUCDMACciDCiDetE+UkALIgLIQAUAlNrljLvYgJYBmiZqA9gLZeMAufRgDsA5gCEAhnwDGAC0QBCALyIhAVwA2GqnQY5aevZx79BoyTNll1WgDSrN2gNzU9AX1eIPunJ4TIiYjBKTwNDY14BYXEpOQB+ADoASSEANw4AawBTa0d7G2dPb3o/JCzUrKE+RABRCqqACQkhABMNLIAnNG5IsxjLFxg3IA=

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ThomasGoulet73 Not the same code. M2 copies the event and is then immune to further changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ghost ghost assigned brunom Jul 19, 2022
@pchaurasia14 pchaurasia14 added the Community Contribution A label for all community Contributions label Jul 20, 2022
@singhashish-wpf singhashish-wpf merged commit acbb3a8 into dotnet:main Jul 21, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants