title: Creating thread safe variable in c#
body: <p>I have a static variable which is accessed by multiple threads in multiple object.  The problem is if I set value in one thread it does not reflect in another thread. 
  To resolve the issue I made the variable thread static but still the value changed in one thread does to reflect in another thread. That’s how I declared the variable:</p>
  
  <pre><code>[ThreadStatic]
  public static string ThreadVar;
  </code></pre>
  
  <p>Any suggestion on how to resolve the issue?</p>