title: If a thread calls Acquire() on a critical section, will that lock be freed if a different thread calls Release()?
body: <p>I'm using Embarcadero's critical section implementation, <strong>TCriticalSection,</strong> but their documentation doesn't answer my question.</p>
  
  <p>If we have a global critical section object:</p>
  
  <pre><code>namespace
  {
     //delphi style class must be constructed on the heap
     TCriticalSection* criticalSection = new TCriticalSection();
  }
  
  //somewhere in thread 1...
  criticalSection-&gt;Acquire();
  
  //somewhere in thread2...
  criticalSection-&gt;Release();
  </code></pre>
  
  <p>Will the release call in thread2 open up the critical section?</p>
  
  <p>I ask because I have RAII class which releases the lock during destruction, so we don't enter deadlock if the code throws an exception. However the critical section is only a part of the method.</p>
  
  <pre><code>//...
  CRITICAL_SECTION_LOCK lock( criticalSection );
  OneAtATimePlease();
  lock.Release(); 
  //...
  </code></pre>
  
  <p>So I don't want to put the critical section inside OneAtATimePlease() because then we'll be handling locks for every single call to that method in the code.</p>