home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / dnet / dnet2.3.2 / amiga / lib / fixsignal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-29  |  967 b   |  37 lines

  1. /*
  2.  *  FixSignal.C
  3.  */
  4.  
  5. #include "lib.h"
  6.  
  7. #include <exec/lists.h>
  8.  
  9. /* set the signal  for this channel's port signal bit, if there is something
  10. ** in the channel's MsgList, or if there is something in the channel's rdy list
  11. */
  12.  
  13. /* 
  14. **  according to the RKM's, setting signals like this is 'Dangerous'  
  15. **  On the other hand, this is generally called when the channel has had
  16. **  something processed on it, which might not be that bad...
  17. */
  18.  
  19. /* 
  20. **check if the channel is not empty. If so, set signal bit for the channel
  21. */
  22. void
  23. FixSignal(_chan)
  24. void *_chan;
  25. {
  26.     CHANN *chan = (CHANN *)_chan;
  27.     /* is the channel's message list empty? */
  28.     if(
  29. /* chan->port.mp_MsgList.lh_Head != (NODE *)&chan->port.mp_MsgList.lh_Tail ||
  30. chan->rdylist.lh_Head != (NODE *)&chan->rdylist.lh_Tail */
  31.        !(  IsMsgPortEmpty((PORT * ) &(chan->port))  &&
  32.            IsListEmpty((LIST *) &chan->rdylist)
  33.     )
  34.     )
  35.     SetSignal(1 << chan->port.mp_SigBit, 1 << chan->port.mp_SigBit);
  36. }
  37.