© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•16mo ago•
5 replies
Stage

Possible race condition?

Maybe I'm just totally off but...

I'm not sure whether
_credentials
_credentials
is implemented safely.

I've been reading a lot on how async works under the hood (specifically the task scheduler) and I don't know whether this variable would be susceptible to a race condition if AuthorizeUserWithCodeAsync is called in rapid succession (see this endpoint which will be calling it). My fear is that if this endpoint is called in rapid succession,
_credentials
_credentials
could be accessed or overwritten in an unintended way. Is this just a
lock
lock
and move on situation or is this actually safe?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Race condition with Interlocked.Exchange
C#CC# / help
14mo ago
Is it possible to remove predicate by condition?
C#CC# / help
3y ago
❔ Implicate without condition
C#CC# / help
3y ago
Learn about RACE CONDITIO N
C#CC# / help
2mo ago