/*******************************************************************************
Generally it appears to be most natural and efficient to use semaphores
(invented in 1965 by W. Dijkstra) for thread synchronization.
A message loop synchronized with a semaphore may be used to wait for "multiple"
events. No event ever gets lost and for every "UP" on the semaphore a "DOWN"
will succeed, nothing more, nothing less.

With events as under the Windows (Tm) OS it is often not clear what will happen
when there are several events, or when when no thread is waiting when an event
gets signaled, or the consequences are not as desired.

However, to port an existing application from Windows to Linux, an emulation
of the Windows events may be required.

There are some implementations of WaitForMultipleObjects() around in the web.
None of these appeared to be simple and efficient enough, so I wrote this one.
Some code snippets are from the CommonC++ library.

--------------------------------------------------------------------------------

The basic idea is to use the subscriber pattern:
	In WaitForMultipleObjects() subscribe at all event sources; the event
	sources then have to signal a central pthread_cond_t.

The public interface is declared in winEmul.h.
A few features are not implemented properly or completely, for instance
PulseEvent(). If these features would be needed, it should not be too difficult
to implement them.

The code as it uses UNICODE at a few places. To change this to ASCII,
replace
	wstring with string
	wchar_t with char
	L"..."     with "..."
*******************************************************************************/

