title: long vs {0L}[0]
body: <p>In one of our old services I found such piece of code (comments are original):</p>
  
  <pre><code>long[] tasksCounter = {0};  //boxing for long counters
  long[] errorsCounter = {0}; //boxing for long counters
  </code></pre>
  
  <p>Further in the code these "arrays" are used with <a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.interlocked?view=netframework-4.7.1" rel="nofollow noreferrer">Interlocked</a> class: <code>Interlocked.Increment(ref errorsCounter[0])</code>, <code>Interlocked.Read(ref errorsCounter[0])</code> etc).</p>
  
  <p>I wonder why did not the author use basicaly <code>long tasksCounter, errorsCounter</code>? </p>
  
  <p>Probably this approach has benefits I don't know about?</p>
  
  <p>It's probably worth mentioning that the variables are used in async lambda. When I change it to basic <code>long</code> Resharper plugin warns me with "Access to modified closure" and suggests to wrap it in array. I found couple of questions about it:</p>
  
  <p><a href="https://stackoverflow.com/questions/235455/access-to-modified-closure">Access to Modified Closure</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1688465/resharper-warning-access-to-modified-closure">ReSharper Warning - Access to Modified Closure</a></p>