title: Creating/Opening Events in C++ and checking if they are fired
body: <p>I have two threads that use an event for synchronization.
  In each thread they use the same call:</p>
  
  <pre><code>::CreateEvent( NULL,TRUE,FALSE,tcEventName )
  </code></pre>
  
  <p>The producer thread is the one that makes the call first, while the consumer thread makes the call last, so it's technically opening, not creating the event... I assume.</p>
  
  <p>But, when SetEvent is called in the producer thread, the same event never gets triggered in the consumer thread (I'm using WaitForMultipleObjects())</p>
  
  <p>Is there a tool that can tell me if the event is actually getting triggered properly.</p>
  
  <p>Also, when I call CreateEvent() in each thread, the returned handle value is different for each... should they be the same?  </p>
  
  <p>Is there a better way to do this that will ensure it will work?</p>
  
  <p>This is on Windows XP using Visual Studio 2005</p>
  
  <p><strong>Edit:</strong>  I did some more checking and found that calling CreateEvent in the producer thread (the second one to call CreateEvent) sets LastError to 183 (ERROR_ALREADY_EXISTS),
  however CreateEvent still returns a handle to the event...what gives?  How can it error as already existing but still return a handle? Or is it supposed to do that?</p>