From d0cf179299952b716333e437a8264610e5b4740f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 20 Feb 2007 14:31:26 +0000 Subject: [PATCH] * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when exit_state indicates that we've visited do_exit. * sync.h (lock_process::lock_process): Use renamed exit_state - ES_PROCESS_LOCKED. * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/exceptions.cc | 4 ++-- winsup/cygwin/sync.h | 4 ++-- winsup/cygwin/winsup.h | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b7a1a3a8a..da11de4e9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2007-02-20 Christopher Faylor + + * exceptions.cc (_cygtls::signal_exit): Only call myself.exit when when + exit_state indicates that we've visited do_exit. + * sync.h (lock_process::lock_process): Use renamed exit_state - + ES_PROCESS_LOCKED. + * winsup.h: Rename ES_MUTO_SET to ES_PROCESS_LOCKED. + 2007-02-20 Corinna Vinschen * fhandler_socket.cc (fhandler_socket::bind): Remove printing wrong diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 9ccb248c6..df5636970 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1,7 +1,7 @@ /* exceptions.cc Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Red Hat, Inc. + 2005, 2006, 2007 Red Hat, Inc. This file is part of Cygwin. @@ -1288,7 +1288,7 @@ _cygtls::signal_exit (int rc) stackdump (thread_context.ebp, 1, 1); lock_process until_exit (true); - if (hExeced || exit_state) + if (hExeced || exit_state > ES_PROCESS_LOCKED) myself.exit (rc); /* Starve other threads in a vain attempt to stop them from doing something diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h index f7ce7e1b4..dfe2c3921 100644 --- a/winsup/cygwin/sync.h +++ b/winsup/cygwin/sync.h @@ -55,9 +55,9 @@ public: { locker.acquire (); skip_unlock = exiting; - if (exiting && exit_state < ES_SET_MUTO) + if (exiting && exit_state < ES_PROCESS_LOCKED) { - exit_state = ES_SET_MUTO; + exit_state = ES_PROCESS_LOCKED; muto::set_exiting_thread (); } } diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 83ca0feac..2a4ddf8ee 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -185,7 +185,7 @@ extern "C" int dll_noncygwin_dllcrt0 (HMODULE, per_process *); enum exit_states { ES_NOT_EXITING = 0, - ES_SET_MUTO, + ES_PROCESS_LOCKED, ES_GLOBAL_DTORS, ES_EVENTS_TERMINATE, ES_THREADTERM,