title: can we call WaitForSingleObject multiple times from single thread for Mutex
body: <p>We have wrapper of mutex object.Constructor of this wrapper creates a mutex . Also it has Enter and Leave functions which basically calls WaitForSingleObject and ReleaseMutex .</p>
  
  <p>Now program thread is executing multiple funcions like</p>
  
  <pre><code>void A()
  {
    mutexObj-&gt;Enter();
    B();
    mutexObj-&gt;Leave();
  }
  
  void B()
  {
    mutexObj-&gt;Enter();
    C();
    mutexObj-&gt;Leave();
  }
  </code></pre>
  
  <p>I am seeing thread being stopped at B() function. What I have read about mutex is that we can call WaitforSingleObjects multiple times from same thread, then why my code is getting blocked.</p>
  
  <p>Here is implementation of mutex</p>
  
  <pre><code>CMutex::CMutex(const TCHAR *name)
     :  m_hMutex(CreateMutex(NULL, FALSE, name))   
  {
  }
  
      CMutex::~CMutex()
      {
         if (m_hMutex != NULL)
         {
            CloseHandle(m_hMutex);
            m_hMutex= NULL;
         }
      }
  
       bool Enter(DWORD milli= INFINITE){
           HANDLE handles[1]= { m_hMutex };
           return(MsgWaitForMultipleObjects(1,handles,FALSE, milli,QS_ALLINPUT) == WAIT_OBJECT_0);
          }
       void Leave(){ReleaseMutex(m_hMutex);}
  </code></pre>