# ifndef NO_WHAT
/*
 *      SCCS file type - Emulator Include File
 *
 *      What identification string:
 */
static char *_S_SyncMacs = "@(#)EM_SyncMacs.h	3.1";
# endif

/* MACROS for Declarations */

#define SHARED Semaphore qm;

#define SHAREDinit(x,y) (ESY_semInit( &(x).qm, &(y), 1 ))

#define FSHAREDinit(x) (ESY_semInit( &(x).qm, &F.FsyncBlock, 1 ))

#define CSHARED  (Semaphore qm; ProcDescriptor qe;)

#define CSHAREDinit(x,y), ESY_semInit( &(x).qm, &(y), 1 ); (x).qe= NIL;)

#define EVENT  ProcDescriptor

/* MACROS for Regions and Event Queues */

#define REGION(x)  (debug0("\n`REGION'(x)\n"); ESY_wait( &(x).qm ); debug0("in region x\n");)

#define ENDREGION(x)  (debug0("\n`ENDREGION'(x)\n"); ESY_signal( &(x).qm ); debug0("out of region x\n");)

#define  CREGION(x)  (debug0("\n`CREGION'(x)\n"); ESY_wait( &(x).qm ); debug0("in cregion x\n");)

#define  CWAIT(x,y)  (debug0("\n`CWAIT'(x,y)\n"); while( !(x) ) ESY_await( &(y).qe, &(y).qm ) debug0("resume from cwait x\n");)

#define  ENDCREGION(x)  (debug0("\n`ENDCREGION'(x)\n"); ESY_cause( &(x).qe, &(x).qm ); ESY_signal( &(x).qm ); debug0("out of cregion x\n");)

#define  AWAIT(x,y)  (debug0("\n`AWAIT'(y.x)\n"); ESY_await( &(y).(x), &(y).qm ); debug0("resume from await x\n");)

#define  CAUSE(x,y)  (debug0("\n`CAUSE'(y.x)\n"); ESY_cause( &(y).(x), &(y).qm );)
