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

Changed the properties and fields to be a Dictionary based on the Type to avoid keeping 2 lists of metadata per instance #1

Closed
wants to merge 1 commit into from

Conversation

eburgos
Copy link

@eburgos eburgos commented Dec 13, 2017

All tests passed.

Enjoy

@mbican
Copy link
Contributor

mbican commented Jan 30, 2019

it is not thread-safe

{
this.properties = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)
properties[type] = GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)
Copy link
Contributor

Choose a reason for hiding this comment

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

since Dictionary is not thread safe, multiple threads can insert the same type here and break the dictionary

{
this.fields = GetType().GetFields(BindingFlags.Instance | BindingFlags.Public)
fields[type] = GetType().GetFields(BindingFlags.Instance | BindingFlags.Public)
Copy link
Contributor

Choose a reason for hiding this comment

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

since Dictionary is not thread safe, multiple threads can insert the same type here and break the dictionary

@jhewlett jhewlett closed this May 4, 2020
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

Successfully merging this pull request may close these issues.

3 participants