Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!cmcl2!philabs!steinmetz!jesup From: jesup@steinmetz.UUCP Newsgroups: comp.sys.amiga Subject: Re: How much of the console.device do I need to close? Message-ID: <6145@steinmetz.steinmetz.UUCP> Date: Thu, 4-Jun-87 16:16:31 EDT Article-I.D.: steinmet.6145 Posted: Thu Jun 4 16:16:31 1987 Date-Received: Sat, 6-Jun-87 11:37:14 EDT References: <8706012228.AA20376@violet.berkeley.edu> <3213@well.UUCP> Reply-To: jesup@kbsvax.steinmetz.UUCP (Randell Jesup) Organization: General Electric CRD, Schenectady, NY Lines: 35 In article <3213@well.UUCP> ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) writes: >In article <8706012228.AA20376@violet.berkeley.edu> mwm@VIOLET.BERKELEY.EDU (Mike Meyer, My watch has windows) writes: >>This has the exact same problems mentioned before: the last character >>typed before the window open/close shows up in the input queue. >> > Try this: > > AbortIO (ConsoleRead); > WaitIO (ConsoleRead); > Wait (1L << ConsoleRead -> io_Message -> mn_ReplyPort -> mp_SigBit); ... > I suspect that, when you post the new request, then wait for it, the >old signal somehow gets in and fouls things up. > >Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ Maybe a better solution: AbortIO(ConsoleRead); WaitIO(ConsoleRead); Forbid(); if (ConsoleRead->io_Message->mn_ReplyPort->mp_MsgList.lh_Head->ln_Succ == 0) /* port has no messages in it */ SetSignal(MyTask, 1L << ConsoleRead->io_Message->mn_ReplyPort->mp_SigBit, 0L); /* WARNING: order of parameters is from memory! */ /* that cleared the signal if it was spurious */ Permit(); This assumes that signal has been generated before the WaitIO returns, as was suggested by Leo. In any case, this code should not harm anything. Randell Jesup jesup@ge-crd.arpa jesup@steinmetz.uucp (seismo!rochester!steinmetz!jesup)