title: Multiple events get different instances of a field declared in singleton?
body: <p><strong>Edit: My bad, no strage events behavior. Error was somewhere else in code. Thx everybody for help. Please ignore this question</strong></p>
  
  <p>Please can someone explain to me what is happening here. I'm experiencing an unexpected event behaviour.</p>
  
  <p>There is a singleton class:</p>
  
  <pre><code>internal class QueueListener
  {
     private static readonly object QueueChangeLock = new object();
     private readonly List&lt;IQueuedJobExecutioner&gt; jobsQueue = new List&lt;IQueuedJobExecutioner&gt;();
  
    // Here comes singleton private constructor, Instance property, all classic.
    // Important line in constructor is this:
    QueueManager.NewJobQueued += NewJobQueuedHandler;
  
  private void NewJobQueuedHandler(object sender, NewJobQueuedEventArgs args)
          {
              lock (QueueChangeLock)
              {
                  // This is the problematic place, note this!
                  jobsQueue.Add(args.QueuedJobExecutioner);
              }
          }  
  }
  </code></pre>
  
  <p>Now there is a second class:</p>
  
  <pre><code>public class QueueManager
  {
     public static event NewJobQueuedEventHandler NewJobQueued;
  
     protected void RaiseNewJobQueuedEvent(IQueuedJobExecutioner queuedJobExecutioner)
          {
              if (NewJobQueued != null)
              {
                  NewJobQueued(this, new NewJobQueuedEventArgs { QueuedJobExecutioner = queuedJobExecutioner });
              }
          }
  }
  </code></pre>
  
  <p>Both classes reside on a server. Via WCF calls client executes sth like <code>new QueueManager().MyMethod()</code>, which calls <code>RaiseNewJobQueuedEvent</code>.</p>
  
  <p>Everything works fine, however if two events are raised almost at the same time, I see in debugger the following at the problematic place (see comment in QueueListener):</p>
  
  <ol>
  <li>First event comes. jobsQueue has no members. </li>
  <li>jobsQueue.Add() is executed. jobsQueue has 1 member.</li>
  <li>Second event comes. jobsQueue has no members! How? It's in a singleton and we just added a member!</li>
  <li>jobsQueue.Add() is executed. jobsQueue has 1 member. Again. Member added in step 2 has been lost.</li>
  </ol>
  
  <p>Not judging the design itself (it has some "historical" reasons), why exactly is this happening? Is this expected behavior and event somehow gets at some point a snapshot of jobsQueue or this is nonesense and I'm just missing some part of the puzzle?</p>
  
  <p>Edit:
  I'd say it is a singleton, and is implemented like this (these lines were omitted in original post):</p>
  
  <pre><code>class QueueListener
  {
    private static readonly object SyncRoot = new object();
    private QueueListener()
          {
  //...
          }
  
          public static QueueListener Instance
          {
              get
              {
                  if (instance == null)
                  {
                      lock (SyncRoot)
                      {
                          if (instance == null)
                          {
                              instance = new QueueListener();
                          }
                      }
                  }
  
                  return instance;
              }
          }
  }
  </code></pre>