title: Is a string property itself threadsafe?
body: <p>String's in C# are immutable and threadsafe. But what when you have a public getter property? Like this:</p>
  
  <pre><code>public String SampleProperty{
      get;
      private set;
  }
  </code></pre>
  
  <p>If we have two threads and the first is calling 'get' and the second is calling 'set' at the "same" time, what will happen?</p>
  
  <p>IMHO the set must made a lock to be thread-safe like this:</p>
  
  <pre><code>private string sampleField;
  private object threadSafer = new object();
  
  public String SampleProperty{
      get{ return this.sampleField; }
      private set{
          lock(threadSafer){
              sampleField = value;
          }
      }
   }
  </code></pre>