home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3938 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. From: yeti@adam.com.au (jonathan potter)
  2. Subject: Re: MsgPorts and lists
  3. Newsgroups: comp.sys.amiga.programmer
  4. References: <1527.6618T48T2102@amiga.pp.se>
  5. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  6. NNTP-Posting-Host: eve.adam.com.au
  7. Message-ID: <31227335.0@eden.adam.com.au>
  8. Date: 14 Feb 96 23:41:41 GMT
  9. Path: eden.adam.com.au!not-for-mail
  10.  
  11. Mikael Berglund (mikael.berglund@amiga.pp.se) wrote:
  12. : I read in an old AmigaTech Journal that as an owner of a message port i also
  13. : own the message list and that it is safe to prescan the message list and
  14. : even Remove() them if they are ReplyMsg():ed.
  15.  
  16. You can do what you like with your message list, but if you are adding or 
  17. removing to it other than through GetMsg() and PutMsg(), you must call 
  18. Forbid() first.
  19.  
  20. : What i obviously would want is a message lookahead that do the checking
  21. : without removing the message from the list in the first place. Alternatively
  22. : an UngetMsg() that pushes the message back. Maybe AddHead() it to the list
  23. : again. Is this safe and how should it be done in that case? GadTools are
  24. : involved hence the GT_GetIMsg().
  25.  
  26. You can always PutMsg() the message to another of your tasks, or even 
  27. back to yourself (of course this will go to the end of the list, not the 
  28. beginning). If you must add a message to the head of a queue, call 
  29. Forbid() and then AddHead().
  30.  
  31. Jon
  32.  
  33. +------------------------------------------------------------------+
  34. |     Jonathan Potter      yeti@adam.com.au     +61-412-845-696    |
  35. +------------------------------------------------------------------+
  36.