Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!well!ewhac From: ewhac@well.UUCP Newsgroups: comp.sys.amiga Subject: Re: How much of the console.device do I need to close? Message-ID: <3213@well.UUCP> Date: Wed, 3-Jun-87 19:03:40 EDT Article-I.D.: well.3213 Posted: Wed Jun 3 19:03:40 1987 Date-Received: Sat, 6-Jun-87 06:10:22 EDT References: <8706012228.AA20376@violet.berkeley.edu> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Whole Earth 'Lectronic Link, Sausalito, CA Lines: 50 Summary: Yet another suggestion... In article <8706012228.AA20376@violet.berkeley.edu> mwm@VIOLET.BERKELEY.EDU (Mike Meyer, My watch has windows) writes: >The continueing saga of the quest for the re-openable console window. > >In our last episode, Carolyn Scheppner had suggested: > >>> Haven't done it myself but my guess is that your failure to Remove the >>> initial request is causing the problems. I suggest trying the same code >>> used for aborting and removing an asynchronous printer request: > >This was done. In fact, the code tried was: [ Code deleted ] > >This has the exact same problems mentioned before: the last character >typed before the window open/close shows up in the input queue. > >Anyone got any ideas? > Try this: AbortIO (ConsoleRead); WaitIO (ConsoleRead); Wait (1L << ConsoleRead -> io_Message -> mn_ReplyPort -> mp_SigBit); When I was writing Robotroff, there were occasions that I would need to AbortIO() a timer request so I could reconfigure things. I AbortIO()ed, then WaitIO()ed. I flushed it, right? Apparently not. I would keep getting this phantom signal that Wait() would respond to. I surmised that the AbortIO() posted a reply to your reply port, raising a signal bit. WaitIO() apparently then checks to see if the queue has anything. If so, it grabs it right away, and doesn't bother to clear the signal bit. So you still have an outstanding signal pending to your task... er.. process... er.. whatever. The above convoluted Wait() statement will clear it. I suspect that, when you post the new request, then wait for it, the old signal somehow gets in and fouls things up. If CATS would like the code that created this condition, I'm sure I could hack something together. Be warned, however, that I have a sneaking suspicion that the above hack has a very low probability of working for you.... Good luck. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ \_ -_ Bike shrunk by popular demand, dual ---> !{well,unicom}!ewhac O----^o But it's still the only way to fly. hplabs / (pronounced "AE-wack") "Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor