title: How do I know if this C# method is thread safe?
body: <p>I'm working on creating a call back function for an ASP.NET cache item removal event.</p>
  
  <p>The documentation says I should call a method on an object or calls I know will exist (will be in scope), such as a static method, but it said I need to ensure the static is thread safe.</p>
  
  <p>Part 1: What are some examples of things I could do to make it un-thread safe?</p>
  
  <p>Part 2: Does this mean that if I have</p>
  
  <pre><code>static int addOne(int someNumber){
      int foo = someNumber;
      return foo +1; 
  }
  </code></pre>
  
  <p>and I call Class.addOne(5); and Class.addOne(6); simutaneously, Might I get 6 or 7 returned depending on who which invocation sets foo first? (i.e. a race condition)</p>