Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!mephisto!gatech!galbp!samna!jeff From: jeff@samna.UUCP (jeff) Newsgroups: comp.windows.x Subject: Re: Problem with Signals Message-ID: <203@samna.UUCP> Date: 7 Mar 90 23:33:58 GMT References: <9002281729.AA02895@wilkins.bcm.tmc.edu> <132399@sun.Eng.Sun.COM> <23695@masscomp.ccur.com> Reply-To: jeff@samna.UUCP (Jeff Barber) Organization: Samna Corporation, Atlanta Lines: 38 In article <23695@masscomp.ccur.com> mitch@westford.ccur.com (Mitchel Kuninsky) writes: :I envision a signal handler like: : : SignalHandler : { : sigFlag = TRUE; : } : :and an XtMainLoop like: : : MyMainLoop() : { : XEvent event; : : for (;;) : { :(1) XtNextEvent( &event ); : if (event.type != NULL_EVENT) /* or something like this. */ : XtDispatchEvent( &event ); : if (sigFlag) : { : process signal. : Inhibit signals. : sigFlag = FALSE; :(2) Enable signals. : } : } : } This may be kind of nit-picking, but ... You have a nasty race here. What if a signal arrives between the re-enabling of signals at (2) and the next call to XtNextEvent at (1). I believe this points out the need to have the signal-handling more tightly integrated with the Intrinsics code. --- Jeff