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

Thread Safety issue in Moq reported by Infer# report #1347

Closed
IngawaAb-bh opened this issue Jun 22, 2023 · 1 comment
Closed

Thread Safety issue in Moq reported by Infer# report #1347

IngawaAb-bh opened this issue Jun 22, 2023 · 1 comment

Comments

@IngawaAb-bh
Copy link

C:/projects/moq4/src/Moq/SetupCollection.cs:107: warning: Thread Safety Violation
Read/Write race. Non-private method SetupCollection.FindLast(...) reads without synchronization from container this.Moq.SetupCollection.setups via call to List1<!0>.get_Count(). Potentially races with write in method SetupCollection.Clear()`.
Reporting because this access may occur on a background thread.

@stakx
Copy link
Contributor

stakx commented Jun 27, 2023

This is technically correct, but it really shouldn't matter as it's only a fast-path optimization.

@stakx stakx closed this as completed Jul 20, 2023
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

No branches or pull requests

2 participants