ExamineLocalSemaphore
Returns the current value of a local semaphore
#include <nwsemaph.h>
int ExamineLocalSemaphore (
LONG semaphoreHandle);
If successful, this function returns the current value of a semaphore.
WARNING:If a bad semaphore handle is specified, the server abends.
This function returns the current value of a semaphore. The semaphore value is decremented for each WaitOnLocalSemaphore and incremented for each SignalLocalSemaphore. A positive semaphore value indicates that the thread can access the associated resource. If the semaphore value is zero or negative, the thread must either enter a waiting queue by calling the function WaitOnLocalSemaphore, or temporarily abandon its attempt to access the resource.
A semaphore handle is obtained by calling OpenLocalSemaphore.