title: Is there a C++ equivalent of WaitforSingleObject?
body: <p>I need to rewrite some code that uses the windows WaitforSingleObject function.</p>
  
  <pre><code>myEvent = CreateEvent( NULL, FALSE, FALSE, szName );
  WaitForSingleObject( myEvent, nMilliseconds );
  </code></pre>
  
  <p>I need to wait for an event or for a timeout to happen.
  Is there an equivalent to this in straight C++??</p>
  
  <p>I am using STL C++11 and not any other libraries such as boost.</p>