SignalLocalSemaphore

Increments the semaphore value of the specified semaphore

Local Servers:nonblocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Thread

Syntax

  #include <nwsemaph.h>  
   
  int SignalLocalSemaphore  (  
     LONG   semaphoreHandle); 
  

Parameters

semaphoreHandle
(IN) Specifies the semaphore handle of an open semaphore.

Return Values

If successful, this function returns zero.

WARNING:A bad semaphore handle causes the server to abend.

Remarks

A thread normally call this function when finished accessing the resource associated with the semaphore.

A thread can also use this function to restart another thread waiting on the semaphore, as a means of interprocess synchronization.

If there are threads waiting on the semaphore (the semaphore value is negative), the first thread in the queue is released (made runnable).

A semaphore handle can be obtained by calling OpenLocalSemaphore.

See Also

CloseLocalSemaphore, ExamineLocalSemaphore, OpenLocalSemaphore, TimedWaitOnLocalSemaphore, WaitOnLocalSemaphore