OS/2 Semaphore API Differences

These APIs are included in your application by including the following definition in your application source file.

#define INCL_DOSSEMAPHORES

OS/2 Event Semaphore API Differences

The following describes the implementation differences between the OS2Linux library and the real OS/2 event semaphore APIs.

When multiple threads wait for an OS/2 event semaphore to post a single post operation to the semaphore will release all the waiting threads.. Under the OS/2Linux library there is a one-to-one correspondence between a post operation and the release of a single waiting thread. If three threads are waiting on an OS/2Linux event semaphore it will take three post operations to the semaphore to release all three threads.

DosCreateEventSem

APIRET APIENTRY DosCreateEventSem (PSZ pszName, PHEV phev, ULONG flAttr,
                                   BOOL32 fState);

DosOpenEventSem

APIRET APIENTRY DosOpenEventSem (PSZ pszName, PHEV phev);

DosCloseEventSem

APIRET APIENTRY DosCloseEventSem (HEV hev);

DosResetEventSem

APIRET APIENTRY DosResetEventSem (HEV hev, PULONG pulPostCt);

DosPostEventSem

APIRET APIENTRY DosPostEventSem (HEV hev);

DosWaitEventSem

APIRET APIENTRY DosWaitEventSem (HEV hev, ULONG ulTimeout);

DosQueryEventSem

APIRET APIENTRY DosQueryEventSem (HEV hev, PULONG pulPostCt);

OS/2 Mutex Semaphore API Differences

The following describes the implementation differences between the OS2Linux library and the real OS/2 mutex semaphore APIs.

DosCreateMutexSem

APIRET APIENTRY DosCreateMutexSem (PSZ pszName, PHMTX phmtx, ULONG flAttr,
                                   BOOL32 fState);

DosOpenMutexSem

APIRET APIENTRY DosOpenMutexSem (PSZ pszName, PHMTX phmtx);

DosCloseMutexSem

APIRET APIENTRY DosCloseMutexSem (HMTX hmtx);

DosRequestMutexSem

APIRET APIENTRY DosRequestMutexSem (HMTX hmtx, ULONG ulTimeout);

DosReleaseMutexSem

APIRET APIENTRY DosReleaseMutexSem (HMTX hmtx);

DosQueryMutexSem

APIRET APIENTRY DosQueryMutexSem (HMTX hmtx, PID *ppid, TID *ptid,
                                  PULONG pulCount);

OS/2 Muxwait Semaphore API Differences

The following describes the implementation differences between the OS2Linux library and the real OS/2 muxwait semaphore APIs.

DosCreateMuxWaitSem

APIRET APIENTRY DosCreateMuxWaitSem (PSZ pszName, PHMUX phmux,
                                     ULONG cSemRec, PSEMRECORD pSemRec,
                                     ULONG flAttr);

DosOpenMuxWaitSem

APIRET APIENTRY DosOpenMuxWaitSem (PSZ pszName, PHMUX phmux);

DosCloseMuxWaitSem

APIRET APIENTRY DosCloseMuxWaitSem (HMUX hmux)

DosAddMuxWaitSem

APIRET APIENTRY DosAddMuxWaitSem (HMUX hmux, PSEMRECORD pSemRec);

DosDeleteMuxWaitSem

APIRET APIENTRY DosDeleteMuxWaitSem (HMUX hmux, HSEM hSem);

DosWaitMuxWaitSem

APIRET APIENTRY DosWaitMuxWaitSem (HMUX hmux, ULONG ulTimeout,
                                   PULONG pulUser);

DosQueryMuxWaitSem

APIRET APIENTRY DosQueryMuxWaitSem (HMUX hmux, PULONG pcSemRec,
                                    PSEMRECORD pSemRec, PULONG pflAttr);