typedef struct _DOSFSRSEM { /* dosfsrs */ USHORT cb; /* Length of this structure (bytes) */ PID pid; /* Process ID of owner or zero */ TID tid; /* Thread ID of owner or zero */ USHORT cUsage; /* Reference count */ USHORT client; /* 16 bit field for use by owner */ ULONG sem; /* OS/2 Ram Semaphore */ } DOSFSRSEM; #define INCL_DOSSEMAPHORES USHORT rc = DosFSRamSemClear(FSRamSemStructure); PDOSFSRSEM FSRamSemStructure; /* Address of structure */ USHORT rc; /* return code */
Example
This example requests a FS RAM semaphore and then clears it.
#define INCL_DOSSEMAPHORES #define NOT_OWNED 0 #define START 0 #define START_LONG 0L #define TIME_OUT 1000L DOSFSRSEM SemStruct; USHORT rc; SemStruct.cb = sizeof(SemStruct); /* Initialize FS Sem */ SemStruct.pid = NOT_OWNED; SemStruct.tid = NOT_OWNED; SemStruct.cUsage = START; SemStruct.client = START; SemStruct.sem = START_LONG; if(!DosFSRamSemRequest(&SemStruct, /* Address of structure */ TIME_OUT)) /* Timeout */ rc = DosFSRamSemClear(&SemStruct); /* Address of structure */