# 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 */

translate(SHARED, Semaphore qm; )

define(SHAREDinit, ESY_semInit( &($1).qm, &($2), 1 ))

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

translate(CSHARED, Semaphore qm; ProcDescriptor qe; )

define(CSHAREDinit, ESY_semInit( &($1).qm, &($2), 1 ); ($1).qe= NIL;)

translate(EVENT, ProcDescriptor )

/* MACROS for Regions and Event Queues */

define(REGION, debug0("\n`REGION'($1)\n"); ESY_wait( &($1).qm ); debug0("in region $1\n");)

define(ENDREGION, debug0("\n`ENDREGION'($1)\n"); ESY_signal( &($1).qm ); debug0("out of region $1\n");)

define(CREGION, debug0("\n`CREGION'($1)\n"); ESY_wait( &($1).qm ); debug0("in cregion $1\n");)

define(CWAIT, debug0("\n`CWAIT'($1,$2)\n"); while( !($1) ) ESY_await( &($2).qe, &($2).qm ) debug0("resume from cwait $1\n");)

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

define(AWAIT, debug0("\n`AWAIT'($2.$1)\n"); ESY_await( &($2).($1), &($2).qm ); debug0("resume from await $1\n");)

define(CAUSE, debug0("\n`CAUSE'($2.$1)\n"); ESY_cause( &($2).($1), &($2).qm );)
