rem: Signal((struct Task *) iounit->Process, SIGBREAKF_CTRL_F);
add: Signal((struct Task *) iounit->Process, 1UL << iounit->SyncSignal);
context: DevProc( void ){  struct Process *proc;  struct StartupMessage *sm;  struct AHIDevUnit *iounit;  BYTE  signalbit;  proc = (struct Process *)FindTask(NULL);  WaitPort(&proc->pr_MsgPort);  sm = (struct StartupMessage *)GetMsg(&proc->pr_MsgPort);  iounit = sm->Unit;  iounit->Process = NULL;  iounit->PlayerHook.h_Entry    = (HOOKFUNC) HookEntry;  iounit->PlayerHook.h_SubEntry = (HOOKFUNC) PlayerFunc;  iounit->PlayerHook.h_Data     = iounit;  iounit->RecordHook.h_Entry    = (HOOKFUNC) HookEntry;  iounit->RecordHook.h_SubEntry = (HOOKFUNC) RecordFunc;  iounit->RecordHook.h_Data     = iounit;  iounit->SoundHook.h_Entry    = (HOOKFUNC) HookEntry;  iounit->SoundHook.h_SubEntry = (HOOKFUNC) SoundFunc;  iounit->SoundHook.h_Data     = iounit;  iounit->ChannelInfoHook.h_Entry    = (HOOKFUNC) HookEntry;  iounit->ChannelInfoHook.h_SubEntry = (HOOKFUNC) ChannelInfoFunc;  iounit->ChannelInfoHook.h_Data     = iounit;  iounit->ChannelInfoStruct = AllocVec(      sizeof(struct AHIEffChannelInfo) + (iounit->Channels * sizeof(ULONG)),      MEMF_PUBLIC | MEMF_CLEAR);  iounit->Master=proc;  signalbit = AllocSignal(-1);  iounit->PlaySignal = AllocSignal(-1);  iounit->RecordSignal = AllocSignal(-1);  iounit->SampleSignal = AllocSignal(-1);  if((signalbit != -1)  && (iounit->PlaySignal != -1)  && (iounit->RecordSignal != -1)  && (iounit->SampleSignal != -1)  && (iounit->ChannelInfoStruct != NULL)  )  {    /* Set up our Unit's MsgPort. */    iounit->Unit.unit_MsgPort.mp_SigBit = signalbit;    iounit->Unit.unit_MsgPort.mp_SigTask = (struct Task *)proc;    iounit->Unit.unit_MsgPort.mp_Flags = PA_SIGNAL;    /* Allocate the hardware */    if(AllocHardware(iounit, AHIBase))    {      /* Set iounit->Process to pointer to our unit process.         This will let the Unit init code know that were         are okay. */      iounit->Process = proc;    }  }  /* Reply to our startup message */  ReplyMsg(&sm->Msg);  if(iounit->Process)  {    ULONG  waitmask,signals;    waitmask = (1L << signalbit)             | SIGBREAKF_CTRL_E    // Dummy signal to wake up task             | SIGBREAKF_CTRL_F    // Quit signal             | (1L << iounit->PlaySignal)             | (1L << iounit->RecordSignal)             | (1L << iounit->SampleSignal);    while(TRUE)    {      signals = Wait(waitmask);      /* Have we been signaled to shut down? */      if(signals & SIGBREAKF_CTRL_F)        break;      if(signals & (1L << iounit->SampleSignal))      {        RethinkPlayers(iounit,AHIBase);      }      if(signals & (1L << signalbit))      {        struct AHIRequest *ioreq;        while((ioreq = (struct AHIRequest *) GetMsg(&iounit->Unit.unit_MsgPort)))        {          PerformIO(ioreq,AHIBase);        }      }            if(signals & (1L << iounit->PlaySignal))      {        AHIObtainSemaphore(&iounit->Lock);        UpdateSilentPlayers(iounit,AHIBase);        AHIReleaseSemaphore(&iounit->Lock);      }      if(signals & (1L << iounit->RecordSignal))      {        iounit->ValidRecord = TRUE;        FeedReaders(iounit,AHIBase);      }    }  }  FreeHardware(iounit, AHIBase);  FreeSignal(iounit->SampleSignal);  iounit->SampleSignal = -1;  FreeSignal(iounit->RecordSignal);  iounit->RecordSignal = -1;  FreeSignal(iounit->PlaySignal);  iounit->PlaySignal = -1;  FreeVec(iounit->ChannelInfoStruct);  if(iounit->Process)  {    Forbid();    Signal((struct Task *) iounit->Process, SIGBREAKF_CTRL_F);  }  FreeSignal(signalbit);}