title: How to easy make this counter property thread safe?
body: <p>I have property definition in class where i have only Counters, this must be thread-safe and this isn't because <code>get</code> and <code>set</code> is not in same lock, How to do that?</p>
  
  <pre><code>    private int _DoneCounter;
      public int DoneCounter
      {
          get
          {
              return _DoneCounter;
          }
          set
          {
              lock (sync)
              {
                  _DoneCounter = value;
              }
          }
      }
  </code></pre>