Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!rutgers!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.programmer Subject: Re: WaitIO which waits also on CTRL-C wanted Message-ID: <20608@cbmvax.commodore.com> Date: 12 Apr 91 22:14:26 GMT References: <1991Apr9.115224.2842@forwiss.uni-passau.de> <1991Apr9.133921.11938@cs.uow.edu.au> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 27 In article <1991Apr9.133921.11938@cs.uow.edu.au> u8705377@cs.uow.edu.au (Paul Anthony Wilkinson) writes: >>Has someone written a WaitIO function, which waits on the >>IO *and* on CTRL-C ? > SendIO(SerialIO); /* Start IO but do not wait */ > Wait( SIGBREAKF_CTRL_C | 1L << SerialMP->mp_SigBit); > > SerialMP is a pointer to the message port associated with your > IOExtSer or whatever. > >This waits on the signal bit of the message port (which is set when >the device "Replys" to your IO request) OR the CTRL-C Signal. One thing to be careful of: when using requests and ports in this manner, it's possible for the signal bit to alreayd be set when you do the SendIO. You should NEVER assume the request has come back until you either WaitIO(), or GetMsg() it from the port (you could use CheckIO to know whether to call WaitIO/GetMsg, especially useful if the port is ued for multiple requests, etc). -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup Disclaimer: Nothing I say is anything other than my personal opinion. Thus spake the Master Ninjei: "To program a million-line operating system is easy, to change a man's temperament is more difficult." (From "The Zen of Programming") ;-)