X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 21 Dec 2012 18:02:19 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Intermittent failures retrieving process exit codes Message-ID: <20121221170219.GF18188@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <50C2498C DOT 2000003 AT coverity DOT com> <50C276AC DOT 9090301 AT mailme DOT ath DOT cx> <50D401EF DOT 9040705 AT coverity DOT com> <20121221103241 DOT GD18188 AT calimero DOT vinschen DOT de> <20121221161024 DOT GA10871 AT ednor DOT casa DOT cgf DOT cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20121221161024.GA10871@ednor.casa.cgf.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Dec 21 11:10, Christopher Faylor wrote: > On Fri, Dec 21, 2012 at 11:32:41AM +0100, Corinna Vinschen wrote: > >Maybe the signal thread should really not exit by itself, but just > >wait until the TerminateThread is called. Chris? > > If the analysis is correct, that just fixes one symptom doesn't it? > There are potentially many threads running in any Cygwin program > and it sounds like any one of them could trigger this. Right. I guess the question is how to synchronize things so that the thread calling TerminateProcess is actually the last one, making sure its return value is used. Maybe the NtQueryInformationThread(ThreadAmILastThread) call is of some help. Or we have to keep all thread IDs of the self-started threads available to terminate them explicitely at process exit. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple