"is the ternary operator (?:) thread safe in c#?" Code Answer

1

it is not threadsafe.

?: is just shortcut for normal if, so your if sample is equivalent to ? one - you can get price lower than 100 if there is no locking outside this code.

By Marek R on January 5 2022

Answers related to “is the ternary operator (?:) thread safe in c#?”

Only authorized users can answer the Search term. Please sign in first, or register a free account.