title: Win32 alternative to pthread
body: <p>Is it possible to write this using the standard win32 CreateMutex style code. I am just wondering if I want to introduce a new library to our application or if I can find a way to write this myself. I just can't figure out how to to the wait inside a CriticalSection. This is my current working code with the pthread library.</p>
  
  <pre><code>T remove() {
      pthread_mutex_lock(&amp;m_mutex);
      while (m_queue.size() == 0) {
          pthread_cond_wait(&amp;m_condv, &amp;m_mutex);
      }
      T item = m_queue.front();
      m_queue.pop_front();
      pthread_mutex_unlock(&amp;m_mutex);
      return item;
  }
  </code></pre>