X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Sun, 11 Jan 2009 11:37:29 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Signal handling in Win32 GUI programs
Message-ID: <20090111163729.GB9992@ednor.casa.cgf.cx>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <496A1DBC.7070004@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <496A1DBC.7070004@gmail.com>
User-Agent: Mutt/1.5.16 (2007-06-09)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Note-from-DJ: This may be spam

On Sun, Jan 11, 2009 at 04:26:36PM +0000, Andy Koppe wrote:
> Is there something special about signal handling in Win32 GUI programs? 
> With MinTTY, I'm finding that signals sent to it are only delivered when 
> writing data to the child process (i.e. when you try to kill it, it stays 
> open until a key is pressed).

I don't know if this is what you are seeing but If you are blocked in a
Windows function like WaitMessage or WaitForSingleObject, the signal
will not be delivered until some random time after you leave the
function.  We used to try to interrupt blocking windows functions but it
caused too many unpredictable problems.

One way around this is to start a thread and wait for signals in that
thread.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

