From ef4d65ba95a0a589d28cb778aca87c5aff9378f1 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 7 Nov 2003 18:21:05 +0000 Subject: * cygthread.cc (cygthread::freerange): Set inuse count. Avoid setting ev from h as h would be NULL at this point. (cygthread::operator new): Issue debugging info when overflowing the thread pool. (cygthread::cygthread): Set ev from h here after h has been initialized. --- winsup/cygwin/cygthread.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/cygthread.cc') diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index c4c871cf7..fa9781e8d 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -128,7 +128,7 @@ cygthread::freerange () { cygthread *self = (cygthread *) calloc (1, sizeof (*self)); self->is_freerange = true; - self->ev = self->h; + self->inuse = 1; return self; } @@ -153,6 +153,8 @@ new (size_t) char buf[1024]; if (!GetEnvironmentVariable ("CYGWIN_FREERANGE_NOCHECK", buf, sizeof (buf))) api_fatal ("Overflowed cygwin thread pool"); + else + thread_printf ("Overflowed cygwin thread pool"); #endif info = freerange (); /* exhausted thread pool */ @@ -180,6 +182,8 @@ cygthread::cygthread (LPTHREAD_START_ROUTINE start, LPVOID param, this, 0, &id); if (!h) api_fatal ("thread handle not set - %p<%p>, %E", h, id); + if (is_freerange) + ev = h; thread_printf ("created thread %p", h); } } -- cgit v1.2.3