Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-11-07 21:21:05 +0300
committerChristopher Faylor <me@cgf.cx>2003-11-07 21:21:05 +0300
commitef4d65ba95a0a589d28cb778aca87c5aff9378f1 (patch)
tree4a3a0f625e75684070daab9a50fcac6cb2357992 /winsup/cygwin/cygthread.cc
parent2985521f84ccc8bf626482d80e4a8c292d5413b9 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r--winsup/cygwin/cygthread.cc6
1 files changed, 5 insertions, 1 deletions
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);
}
}