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

Make Barrel and HttpCache singletons thread-safe #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Fusion86
Copy link

@Fusion86 Fusion86 commented Feb 29, 2020

Uses technique described by Jon Skeet here https://csharpindepth.com/articles/singleton#lazy
MSDN docs: https://docs.microsoft.com/en-us/dotnet/api/system.lazy-1

I couldn't test this on Android/iOS/macOS because I don't have a Xamarin development environment. Maybe you could test this with your neat Azure pipelines? Though feel free to decline this pull request if testing it would take too much of your time, since these changes usually aren't needed (I have a pretty specific use case where I need the singleton to be thread safe).

E: The tests passed, so I guess it should work?

@jamesmontemagno jamesmontemagno self-requested a review March 2, 2020 06:27
@mos379
Copy link

mos379 commented Oct 24, 2020

wouldn't that solve #56 ?

@jamesmontemagno
Copy link
Owner

@Redth thoughts?

@jafin
Copy link

jafin commented Oct 2, 2023

Would be great to have this merged + published... Just hit issue when attempting to use the current build. Rebuilt with this PR and it worked fin!

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.

4 participants