DosWaitEventSem enables a thread to wait for an event semaphore to be posted.
This function can be called by any thread in the process that created the semaphore. Threads in other processes can also call this function, but they must first gain access to the semaphore by calling DosOpenEventSem.