dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosSemClear (1.2)
Function Group  Overview  Changes               Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSSEMAPHORES
 
USHORT DosSemClear(hsem)
HSEM hsem;    /* semaphore handle */
 
The DosSemClear function clears a system or RAM semaphore that has been set
by using the DosSemRequest, DosSemSet, or DosSemSetWait function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hsem       Identifies the semaphore to clear. This value can be the handle
           of a system semaphore that has been previously created or opened
           by using the DosCreateSem or DosOpenSem function, or it can be
           the address of a RAM semaphore.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
 
     ERROR_EXCL_SEM_ALREADY_OWNED
 
Comments
 
The DosSemClear function cannot clear a system semaphore that is owned by
another process unless the semaphore is nonexclusive.
 
Example
 
This example uses the DosSemClear function to clear a RAM semaphore and a
system semaphore:
 
ULONG hsem = 0;
HSYSSEM hsys;
DosSemClear(&hsem);   /* clears RAM semaphore    */
DosSemClear(hsys);    /* clears system semaphore */
 
See Also
 
DosCreateSem, DosMuxSemWait, DosOpenSem, DosSemRequest, DosSemSet,
DosSemSetWait, DosSemWait