WaitOnLocalSemaphore
Decrements the semaphore value of the specified semaphore
#include <nwsemaph.h>
int WaitOnLocalSemaphore (
LONG semaphoreHandle);
If successful, this function returns zero.
WARNING:A bad semaphore handle causes the server to abend.
A thread would typically call this function before accessing the resource associated with the semaphore. An NLM can also use this function to cause a thread to wait until another thread signals it to resume.
If the semaphore value is still greater than or equal to zero after the function decrements it, the thread is not suspended. If the semaphore value is negative, the thread is suspended until the semaphore is signalled one more time than there are threads ahead of the current thread on the specified semaphore’s queue.
A semaphore handle can be obtained by calling OpenLocalSemaphore.