diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1da5f3c98..07d103758 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2002-08-11 Christopher Faylor + + * cygthread.cc (cygthread::cygthread): Close another race. + 2002-08-11 Christopher Faylor * assert.cc (__assert): Call debugger on assertion failure if diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index 00eeb25d0..d1d93375c 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -123,8 +123,15 @@ cygthread::cygthread (LPTHREAD_START_ROUTINE start, LPVOID param, api_fatal ("name should never be NULL"); #endif thread_printf ("name %s, id %p", name, id); - while (ResumeThread (h) == 0) + while (!h || ResumeThread (h) != 1) +#ifndef DEBUGGING Sleep (0); +#else + { + thread_printf ("waiting for %s<%p> to become active", __name, h); + Sleep (0); + } +#endif __name = name; /* Need to set after thread has woken up to ensure that it won't be cleared by exiting thread. */