* 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.
This commit is contained in:
parent
2985521f84
commit
ef4d65ba95
@ -1,3 +1,11 @@
|
|||||||
|
2003-11-07 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2003-11-06 Corinna Vinschen <corinna@vinschen.de>
|
2003-11-06 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* bsdlib.cc (_vwarnx): New function.
|
* bsdlib.cc (_vwarnx): New function.
|
||||||
|
@ -128,7 +128,7 @@ cygthread::freerange ()
|
|||||||
{
|
{
|
||||||
cygthread *self = (cygthread *) calloc (1, sizeof (*self));
|
cygthread *self = (cygthread *) calloc (1, sizeof (*self));
|
||||||
self->is_freerange = true;
|
self->is_freerange = true;
|
||||||
self->ev = self->h;
|
self->inuse = 1;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,6 +153,8 @@ new (size_t)
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
if (!GetEnvironmentVariable ("CYGWIN_FREERANGE_NOCHECK", buf, sizeof (buf)))
|
if (!GetEnvironmentVariable ("CYGWIN_FREERANGE_NOCHECK", buf, sizeof (buf)))
|
||||||
api_fatal ("Overflowed cygwin thread pool");
|
api_fatal ("Overflowed cygwin thread pool");
|
||||||
|
else
|
||||||
|
thread_printf ("Overflowed cygwin thread pool");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
info = freerange (); /* exhausted thread pool */
|
info = freerange (); /* exhausted thread pool */
|
||||||
@ -180,6 +182,8 @@ cygthread::cygthread (LPTHREAD_START_ROUTINE start, LPVOID param,
|
|||||||
this, 0, &id);
|
this, 0, &id);
|
||||||
if (!h)
|
if (!h)
|
||||||
api_fatal ("thread handle not set - %p<%p>, %E", h, id);
|
api_fatal ("thread handle not set - %p<%p>, %E", h, id);
|
||||||
|
if (is_freerange)
|
||||||
|
ev = h;
|
||||||
thread_printf ("created thread %p", h);
|
thread_printf ("created thread %p", h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -618,50 +618,56 @@ fhandler_disk_file::opendir ()
|
|||||||
else if ((dir->__d_dirname = (char *) malloc (len + 3)) == NULL)
|
else if ((dir->__d_dirname = (char *) malloc (len + 3)) == NULL)
|
||||||
{
|
{
|
||||||
set_errno (ENOMEM);
|
set_errno (ENOMEM);
|
||||||
free (dir);
|
goto free_dir;
|
||||||
}
|
}
|
||||||
else if ((dir->__d_dirent =
|
else if ((dir->__d_dirent =
|
||||||
(struct dirent *) malloc (sizeof (struct dirent))) == NULL)
|
(struct dirent *) malloc (sizeof (struct dirent))) == NULL)
|
||||||
{
|
{
|
||||||
set_errno (ENOMEM);
|
set_errno (ENOMEM);
|
||||||
free (dir);
|
goto free_dirname;
|
||||||
free (dir->__d_dirname);
|
|
||||||
}
|
}
|
||||||
else if (access_worker (pc, R_OK) != 0)
|
else if (access_worker (pc, R_OK) != 0)
|
||||||
{
|
goto free_dirent;
|
||||||
free (dir);
|
|
||||||
free (dir->__d_dirname);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcpy (dir->__d_dirname, get_win32_name ());
|
strcpy (dir->__d_dirname, get_win32_name ());
|
||||||
dir->__d_dirent->d_version = __DIRENT_VERSION;
|
dir->__d_dirent->d_version = __DIRENT_VERSION;
|
||||||
cygheap_fdnew fd;
|
cygheap_fdnew fd;
|
||||||
if (fd >= 0)
|
|
||||||
{
|
|
||||||
fd = this;
|
|
||||||
fd->set_nohandle (true);
|
|
||||||
dir->__d_dirent->d_fd = fd;
|
|
||||||
dir->__fh = this;
|
|
||||||
/* FindFirstFile doesn't seem to like duplicate /'s. */
|
|
||||||
len = strlen (dir->__d_dirname);
|
|
||||||
if (len == 0 || isdirsep (dir->__d_dirname[len - 1]))
|
|
||||||
strcat (dir->__d_dirname, "*");
|
|
||||||
else
|
|
||||||
strcat (dir->__d_dirname, "\\*"); /**/
|
|
||||||
dir->__d_cookie = __DIRENT_COOKIE;
|
|
||||||
dir->__handle = INVALID_HANDLE_VALUE;
|
|
||||||
dir->__d_position = 0;
|
|
||||||
dir->__d_dirhash = get_namehash ();
|
|
||||||
|
|
||||||
res = dir;
|
if (fd < 0)
|
||||||
}
|
goto free_dirent;
|
||||||
|
|
||||||
|
fd = this;
|
||||||
|
fd->set_nohandle (true);
|
||||||
|
dir->__d_dirent->d_fd = fd;
|
||||||
|
dir->__fh = this;
|
||||||
|
/* FindFirstFile doesn't seem to like duplicate /'s. */
|
||||||
|
len = strlen (dir->__d_dirname);
|
||||||
|
if (len == 0 || isdirsep (dir->__d_dirname[len - 1]))
|
||||||
|
strcat (dir->__d_dirname, "*");
|
||||||
|
else
|
||||||
|
strcat (dir->__d_dirname, "\\*"); /**/
|
||||||
|
dir->__d_cookie = __DIRENT_COOKIE;
|
||||||
|
dir->__handle = INVALID_HANDLE_VALUE;
|
||||||
|
dir->__d_position = 0;
|
||||||
|
dir->__d_dirhash = get_namehash ();
|
||||||
|
|
||||||
|
res = dir;
|
||||||
|
|
||||||
if (pc.isencoded ())
|
if (pc.isencoded ())
|
||||||
set_encoded ();
|
set_encoded ();
|
||||||
}
|
}
|
||||||
|
|
||||||
syscall_printf ("%p = opendir (%s)", res, get_name ());
|
syscall_printf ("%p = opendir (%s)", res, get_name ());
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
free_dirent:
|
||||||
|
free (dir->__d_dirent);
|
||||||
|
free_dirname:
|
||||||
|
free (dir->__d_dirname);
|
||||||
|
free_dir:
|
||||||
|
free (dir);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dirent *
|
struct dirent *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user