From 1b96f7da4592061bffad3e45181b3fd381c40079 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 9 Jun 2005 23:48:08 +0000 Subject: [PATCH] * cygthread.cc (cygthread::detach): Improve diagnostics for what should be an impossible failure condition. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/cygthread.cc | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f6c06b925..799e17446 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-06-09 Christopher Faylor + + * cygthread.cc (cygthread::detach): Improve diagnostics for what should + be an impossible failure condition. + 2005-06-09 Christopher Faylor * cygtls.h (_local_storage::setmode_file): New element. diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index af60abf2a..896086834 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -344,7 +344,20 @@ cygthread::detach (HANDLE sigwait) break; default: if (!exiting) - api_fatal ("WFMO failed waiting for cygthread '%s', %E", __name); + { + system_printf ("WFMO failed waiting for cygthread '%s', %E", __name); + for (unsigned j = 0; j < n; j++) + switch (WaitForSingleObject (w4[j], 0)) + { + case WAIT_OBJECT_0: + case WAIT_TIMEOUT: + break; + default: + system_printf ("%s handle %p is bad", j ? "semaphore" : "signal_arrived", w4[j]); + break; + } + api_fatal ("exiting on fatal error"); + } break; } /* WAIT_OBJECT_0 means that the thread successfully read something,