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

The OS/2 API Project


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


rc = DosAddMuxWaitSem( hmuxSemaphore, pSemRecord );


HMUX hmuxSemaphore (input)
The handle of the MuxWait semaphore to which another semaphore will be added.

PSEMRECORD pSemRecord (input)
The address of a SEMRECORD to be added to the specified MuxWait semaphore.


The following values can be returned
0NO_ERROROperation was successful.
6ERROR_INVALID_HANDLEError, The value in hmuxSemaphore does not point to a valid semaphore, The calling process must first have access to the semaphore in question
8ERROR_NOT_ENOUGH_MEMORYError, The system memory limit has been exhausted
87ERROR_INVALID_PARAMETERError, One or more of the parameters contains an illegal value.
100ERROR_TOO_MANY_SEMAPHORESError, The system limit of 64 semaphores has been exceeded for this MuxWait semaphore.
105ERROR_SEM_OWNER_DIEDError, The owner of the MuxWait semaphore specified has terminated.
284ERROR_DUPLICATE_HANDLEError, The semaphore referred to in pSemRecord has already been added to the specified MuxWait semaphore.
292ERROR_WRONG_TYPEError, The semaphore referred to in pSemRecord is of a different type than those already in the list for hmuxSemaphore.

Include Info

#include <os2.h>

Usage Explanation

DosAddMuxWaitSem adds an event semaphore or a mutex semaphore a MuxWait semaphore list.

Relevant Structures


All processes that have access to a shared MuxWait semaphore must also have access to the event/mutex semaphore that is to be added to the MuxWait list. If a process does not have access to this semaphore then it will unblock and return the error ERROR_INVALID_HANDLE. DosAddMuxWaitSem will NOT return an error in this case. The processes wishing to gain access to the MuxWait semaphore will return errors until proper access has been obtained.

Sample Code

#define INCL_DOSSEMAPHORES #include <os2.h> HMUX hmuxMySemaphore; /* MySemaphore handle */ SEMRECORD SemRecord; /* Record containing info about the sem */ /* I want to add to MySemaphore's list */ /* access is gained to the semaphore in question */ /* either by DosCreateMuxWaitSem ... */ /* ... or by DosOpenMuxWaitSem */ /* its handle is placed in hmuxMySemaphore */ /* SemRecord is filled with appropriate information about */ /* the semaphore I wish to add to hmuxMySemaphore's list */ rc = DosAddMuxWaitSem(hmuxMySemaphore, &SemRecord); if (rc != 0) { /* We got an error to take care of. */ }

See Also

DosCloseMuxWaitSem, DosCreateMuxWaitSem, DosDeleteMuxWaitSem DosOpenMuxWaitSem, DosQueryMuxWaitSem, DosWaitMuxWaitSem


Joe Phillips - jaiger@eng2.uconn.edu


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

The OS/2 API Project