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.
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
♦