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

Fix FastLazy race condition and waiting thread hanging (#6336) #6707

Merged
merged 6 commits into from May 3, 2023

Conversation

F0b0s
Copy link
Contributor

@F0b0s F0b0s commented May 2, 2023

Fixes #6336

Changes

Fix of two issues:

  1. race condition that leads to multiple producer calls
  2. waiting thread hanging on producer thread exception

Checklist

@Aaronontheweb
Copy link
Member

public T Value { get; }
public bool IsValueCreated() { }
Copy link
Contributor Author

@F0b0s F0b0s May 2, 2023

Choose a reason for hiding this comment

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

Changed to method because with
[MethodImpl(MethodImplOptions.AggressiveInlining)]
it shows slightly better performance

Copy link
Member

@Aaronontheweb Aaronontheweb 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 c2559ff into akkadotnet:dev May 3, 2023
9 of 12 checks passed
@F0b0s F0b0s deleted the fast_lazy_race_condition branch May 3, 2023 19:44
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.

Utility class FastLazy has a race condition
2 participants