d0a81355b0
This allows making the WelsMultipleEventsWaitSingleBlocking function work properly in unix, without polling. If a master event is provided, the function first waits for a signal on that event - once such a signal is received, it is assumed that one of the individual events in the list have been signalled as well. Then the function can proceed to check each of the semaphores in the list using sem_trywait to find the first one of them that has been signalled. Assuming that the master event is signalled in pair with the other events, one of the sem_trywait calls should succeed. The same master event is also used in WelsMultipleEventsWaitAllBlocking, to keep the semaphore values in sync across calls to the both functions.