[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosCloseEventSem

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = 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
0NO_ERRORSemaphore closed successfully
6ERROR_INVALID_HANDLEError, The value in hevSemaphore does not point to a valid semaphore
301ERROR_SEM_BUSYError, Another thread in this process is blocked on the semaphore

Include Info

#define INCL_DOSSEMAPHORES
#include <os2.h>

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.

Relevant Structures

Gotchas

Sample Code

#define INCL_DOSSEMAPHORES #include <os2.h> 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 */ }

See Also

DosCreateEventSem, DosOpenEventSem, DosPostEventSem DosQueryEventSem, DosResetEventSem DosWaitEventSem

Author

Joe Phillips - jaiger@eng2.uconn.edu

Additions

Last modified June 19/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosCloseEventSem