DosCloseEventSem

Syntax
DosCloseEventSem( hevSemaphore )

Parameters
HEV hevSemaphore (input) This is a handle to the event semaphore (HEV) to be closed.

Returns

 * APIRET rc:The following values can be returned

Usage Explanation
DosCloseEventSem decrements, by one (1), the usage count for the semaphore specified by the handle hevSemaphore. If the usage count goes to zero (0) then the semaphore is freed from the system.
 * The usage count for private semaphores is always one (1) so all private semaphores will be freed on successful completion of this call.
 * Shared (named or unnamed) semaphores may have usage counts greater than one (1), therefore they may or may not be freed from system resources on successful completion of DosCloseEventSem.

Sample Code

 * 1) define INCL_DOSSEMAPHORES
 * 2) include 

HEV hevMySemaphore; /* pointer to my semaphore handle */

/* an event semaphore is successfully created */ /* its handle is placed in hevMySemaphore */

rc = DosCloseEventSem(hevMySemaphore);

if (rc != 0) {	 /* We got an error to take care of. */	}	else {	 /* The semaphore was successfully closed */ } 