Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!uunet!infonode!doyle From: doyle@infonode.ingr.com (Doyle Davidson) Newsgroups: comp.windows.x Subject: Signals in X Message-ID: <1991Apr5.162131.7816@infonode.ingr.com> Date: 5 Apr 91 16:21:31 GMT Organization: Intergraph Corp. Huntsville, AL Lines: 46 Under X11R4 how does one design a signal handler in an X application that needs to make X calls itself? Since Xlib is not reentrant(?), how can one make Xlib calls in response to a signal? Example: Child process dies so I need to create a window with a message. A solution that I came up with is as follows (with details removed): main_loop() { while (True) { release_signals(...); allow signals to pass err = select(...); Wait for server data or a signal block_signals(...); block signals from X while (XCheckMaskEvent(my_events)) look for any events process_event(...); process it } } The signal can only fire while I am in select (assuming indivisible instructions) and at that point I am not inside any X calls. Or can I get away with only blocking signals around my "process_event()" routine? Is there a better/more appropriate way? I checked my out of date FAQ list and couldn't find anything. I know this has been discussed before but I can't find any old postings about it. Thanks in advance, Doyle ------------------------------------------------------------------- Doyle C. Davidson | Intergraph Corp. | Intergraph - Everywhere you look!! Third Party Software | 1 Madison Industrial Park | Huntsville, AL 35806 | These comments are... (205) 730-2000 | | X-clusively my own. ..!uunet!ingr!doyle | -or- doyle@ingr.com | -------------------------------------------------------------------