DosFSRamSemRequest

DosFSRamSemRequest

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 = DosFSRamSemRequest(FSRamSemStructure, Timeout);

PDOSFSRSEM       FSRamSemStructure;  /* Address of structure */
LONG             Timeout;            /* Timeout (in milliseconds) */

USHORT           rc;                 /* return code */

Example

This example requests a FS RAM semaphore.

#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;

   rc = DosFSRamSemRequest(&SemStruct,         /* Address of structure */
                           TIME_OUT);          /* Timeout */


[Back: DosFSRamSemClear]
[Next: DosGetCollate]