CloseSemaphore

Decrements a semaphore’s open count

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Server-Based Synchronization

Syntax

  #include <\nlm\nit\nwsync.h>  
   
  int CloseSemaphore (  
     long   semaphoreHandle); 
  

Parameters

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

Return Values

Decimal

Hex

Constant

0

(0x00)

ESUCCESS

255

(0xFF)

ERR_INVALID_SEMAPHORE_HANDLE

Remarks

For cross-platform functionality, call NWCloseSemaphore.

This function decrements the open count of the semaphore, indicating that one less process is holding the semaphore open. If the requesting process is the last process to have this semaphore open, the semaphore is deleted. An application can obtain a semaphore handle by calling OpenSemaphore.

See Also

ExamineSemaphore, OpenSemaphore, SignalSemaphore, WaitOnSemaphore