title: Why expression is always true for 'double-checked-locking'?
body: <p>I have singleton object 'Service' and two methods to initialize and release it:</p>
  
  <pre><code>public class BaseService
  {
      protected static readonly object StaticLockObject = new object();
  }
  
  public abstract class WebServiceBase&lt;TService&gt; : BaseService
      where TService : System.Web.Services.Protocols.SoapHttpClientProtocol, new()
  {
      protected static void EnsureServiceIsOpened()
      {
          if (Service == null)
          {
              lock (StaticLockObject)
              {
                  if (Service == null)
                  {
                      Service = new TService();
                  }
              }
          }
      }
  
      protected static void EnsureServiceIsClosed()
      {
          if (Service != null)
          {
              lock (StaticLockObject)
              {
                  if (Service != null) // Why expression is always true
                  {
                      Service.Dispose();
                      Service = null;
                  }
              }
          }
      }
  </code></pre>
  
  <p>For the line with comment resharper (I use version 5.1) displays a mentioned warning...</p>
  
  <p><strong>Question 1:</strong> Why?</p>
  
  <p><strong>Question 2:</strong> Why it doesn't display "similar" message in 'EnsureServiceIsOpened' method?</p>
  
  <p>Thanks.</p>