Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 20 Mar 2002 11:23:54 -0500
From: Christopher Faylor <cygwin@cygwin.com>
To: cygwin@cygwin.com
Cc: rgibson@MIT.EDU
Subject: Re: alarm();pause();alarm();pause(); doesn't pause in pthread
Message-ID: <20020320162354.GF2762@redhat.com>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com, rgibson@MIT.EDU
References: <5.1.0.14.0.20020320010350.0211c960@po12.mit.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <5.1.0.14.0.20020320010350.0211c960@po12.mit.edu>
User-Agent: Mutt/1.3.23.1i

On Wed, Mar 20, 2002 at 01:03:53AM -0500, Rob Gibson wrote:
>DLL version 1.3.10, running on Windows ME.  I checked the message boards, 
>but did not see this.
>
>Call this code X: {
>   alarm(2);
>   pause();
>   cout << "A";
>   alarm(4);
>   pause();
>   cout << "B";
>   alarm(4);
>   pause();
>   cout << "C";
>   alarm(4);
>   pause();
>   cout << "D";
>}
>
>
>I have two threads.  In the first, my original startup thread, I register a 
>sig handler for SIGALRM.  At this point, if I block the SIGALRM signal, 
>then run X, nothing happens.  Ok.  (If I unblock SIGALRM, I get four calls 
>to my sig handler, spaced the appropriate number of seconds apart.  Ok.)
>
>Now I start a second thread using pthread_create().  In the second thread's 
>function, if I immediately run code X, nothing happens, because my second 
>thread has inherited the blocked nature of SIGALRM.  Ok.

signals do not work with anything but the main thread.  Sorry.

cgf
--
Please do not send me personal email with cygwin questions.
Use the resources at http://cygwin.com/ .

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

