title: Thread safe queue (list) in .net
body: <p>I need to create a thread safe list of items to be added to a lucene index.</p>
  
  <p>Is the following thread safe?</p>
  
  <pre><code>public sealed class IndexQueue
  {
      static readonly IndexQueue instance = new IndexQueue();
      private List&lt;string&gt; items = new List&lt;string&gt;();
  
      private IndexQueue() { }
  
      public static IndexQueue Instance {
          get { return instance; }
      }
  
      private object padlock = new object();
  
      public void AddItem(string item) {
          lock (padlock) {
              items.Add(item);
          }
      }
  }
  </code></pre>
  
  <p>Is it necessary to lock even when getting items from the internal list?</p>
  
  <p>The idea is that we will then have a separate task running to grab the items from indexqueue and add them to the lucene index.</p>
  
  <p>Thanks
  Ben</p>