title: .NET Manual Reset Event
body: <p>In the code below, Main function waits for Manual Reset Event (mre) to be set.
  However, before <strong>the waiting</strong> starts, the sync object is already set to signaled state by other thread.</p>
  
  <p>So, is it safe to wait for "already signaled sync objects"?</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          ManualResetEvent mre = new ManualResetEvent(false);
          ThreadPool.QueueUserWorkItem(new WaitCallback(Func), mre);
          Thread.Sleep(1500);
          mre.WaitOne(100000); // Waiting for already signaled object
          Console.WriteLine("Wait Completed");
      }
  
      public static void Func(object state)
      {
          ManualResetEvent mre = (ManualResetEvent)state;
          mre.Set();
          Console.WriteLine("Mre Is Set");
      }
  }
  </code></pre>