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>2001-09-09 07:34:36 +0400
committerChristopher Faylor <me@cgf.cx>2001-09-09 07:34:36 +0400
commite2ea684e4ecca39aae13d3cdcdcb12cf32621889 (patch)
treed5dcb4a9b1bfb8fe47b57de3ec380312e838c5a7 /winsup/cygwin/sigproc.cc
parentc12a96d12fb912d3da7e1b6d9e68decf7b45b335 (diff)
* fork.cc (fork_parent): Stop malloc activity while fork is in control of the
heap. * sigproc.cc (NZOMBIES): Rename from ZOMBIEMAX for clarity. (zombies): Revert to original behavior. Allocating zombie array resulted in performance hit. * winsup.h: Declare malloc lock routines.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 39a300bf2..a4b9168e4 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -46,7 +46,7 @@ details. */
#define no_signals_available() (!hwait_sig || !sig_loop_wait)
-#define ZOMBIEMAX 4096
+#define NZOMBIES 4096
/*
* Global variables
@@ -99,12 +99,12 @@ Static HANDLE wait_sig_inited = NULL; // Control synchronization of
/* Used by WaitForMultipleObjects. These are handles to child processes.
*/
-Static HANDLE events[PSIZE + 1] = {0}; // All my children's handles++
+Static HANDLE events[PSIZE + 1] = {0}; // All my children's handles++
#define hchildren (events + 1) // Where the children handles begin
Static pinfo pchildren[PSIZE]; // All my children info
Static int nchildren = 0; // Number of active children
-static pinfo *zombies; // All my deceased children info
-static int nzombies; // Number of deceased children
+Static pinfo zombies[NZOMBIES]; // All my deceased children info
+Static int nzombies = 0; // Number of deceased children
Static waitq waitq_head = {0, 0, 0, 0, 0, 0, 0};// Start of queue for wait'ing threads
Static waitq waitq_main; // Storage for main thread
@@ -318,7 +318,7 @@ proc_subproc (DWORD what, DWORD val)
filled up our table or if we're ignoring SIGCHLD, then we immediately
remove the process and move on. Otherwise, this process becomes a zombie
which must be reaped by a wait() call. */
- if (nzombies >= ZOMBIEMAX
+ if (nzombies >= NZOMBIES
|| myself->getsig (SIGCHLD).sa_handler == (void *) SIG_IGN)
{
sigproc_printf ("automatically removing zombie %d", thiszombie);
@@ -543,11 +543,6 @@ sig_dispatch_pending (int justwake)
void __stdcall
sigproc_init ()
{
- if (!zombies)
- zombies = (pinfo *) malloc (sizeof (pinfo) * ZOMBIEMAX);
- else
- nzombies = 0;
-
wait_sig_inited = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL);
ProtectHandle (wait_sig_inited);