dos12.hlp (Table of Contents; Topic list)
DosSemSet (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSSEMAPHORES
 
USHORT DosSemSet(hsem)
HSEM hsem;    /* semaphore handle */
 
The DosSemSet function sets a specified semaphore. A process typically uses
this function to set a semaphore, then waits for the semaphore to clear by
using the DosSemWait or DosMuxSemWait function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hsem       Identifies the semaphore to set. 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 one of the following:
 
     ERROR_EXCL_SEM_ALREADY_OWNED
     ERROR_TOO_MANY_SEM_REQUESTS
 
Comments
 
The DosSemSet function cannot set a system semaphore that is owned by
another process unless the semaphore is nonexclusive.
 
Example
 
This example uses the DosSemSet function to set a RAM semaphore and a system
semaphore:
 
ULONG hsem = 0;
HSYSSEM hsys;
DosSemSet(&hsem);       /* sets a RAM semaphore    */
DosSemSet(hsys);        /* sets a system semaphore */
 
See Also
 
DosCreateSem, DosMuxSemWait, DosOpenSem, DosSemClear, DosSemRequest,
DosSemSetWait, DosSemWait