Intermittent failures retrieving process exit codes

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Dec 21 17:02:00 GMT 2012


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



More information about the Cygwin mailing list