The following code illustrates creating a super group that may contain other synchronization groups.
#include "os2.h"
#include "os2me.h"
ULONG ulRc; /*error return code */
HSTREAM hstream1; /*stream 1 handle */
hstream2; /*stream 2 handle */
MASTER master[2] /*Sync Master Structure */
HSTREAM hstreamMaster;
/*********************************************/
/* Create stream for hstream1 and hstream2. */
/* (See SpiCreateStream) */
/*********************************************/
.
.
.
/**************************************************************/
/* Determine which stream should be used as the master stream */
/* of a synchronized group. */
/**************************************************************/
master[0].hstreamMaster = HSTREAM1;
master[1].hstreamMaster = HSTREAM2;
if (ulRc = SpiDetermineSyncMaster (&hstreamMaster,
&master [0],
2))
return(ulRc); /* error */
/***********************************************************/
/* Use the handle received in hstreamMaster as the master */
/* stream handle. See SpiEnableSync. */
/***********************************************************/