title: How does the ThreadStatic attribute work?
body: <p>How does <code>[ThreadStatic]</code> attribute work? I assumed that the compiler would emit some IL to stuff/retrieve the value in the TLS, but looking at a disassembly it doesn't seem to do it at that level.</p>
  
  <p>As a follow up, what happens if you put it on a non-static member? We had a developer make that mistake and the compiler doesn't even proffer up a warning.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Second question answered here: <a href="https://stackoverflow.com/questions/868537/threadstatic-modified-with-static-c">ThreadStatic Modified with Static C#</a></p>