New answers tagged

1 vote

Thread-safe int wrapper in c#

// read freshest value private int Get() => Interlocked.CompareExchange(ref _value, 0, 0); Using an ...
harold's user avatar
  • 9,059
3 votes
Accepted

Thread-safe int wrapper in c#

Based on the discussion in the comments section I think the code can be greatly simplified: ...
Peter Csala's user avatar
  • 8,520

Top 50 recent answers are included