774 Views
This week, we’ll round out the discussion by talking about the Interlocked CompareExchange() method and how it can be put to use to exchange a value if the current value is what you expected it to be.
Join in on a hand-picked round up of the best .NET articles every day.
Curated by our Moderators and Voted up by our Community. Free.
This week, we’ll round out the discussion by talking about the Interlocked CompareExchange() method and how it can be put to use to exchange a value if the current value is what you expected it to be.
Just a remark, though: for money, we usually use decimal, not double... and Interlocked.CompareExchange doesn't seem to support decimal (there is a generic overload, but it only accepts reference types).