diff options
author | Christopher Faylor <me@cgf.cx> | 2001-09-09 03:34:36 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-09-09 03:34:36 +0000 |
commit | e2ea684e4ecca39aae13d3cdcdcb12cf32621889 (patch) | |
tree | d5dcb4a9b1bfb8fe47b57de3ec380312e838c5a7 /winsup/cygwin/sigproc.cc | |
parent | c12a96d12fb912d3da7e1b6d9e68decf7b45b335 (diff) | |
download | cygnal-e2ea684e4ecca39aae13d3cdcdcb12cf32621889.tar.gz cygnal-e2ea684e4ecca39aae13d3cdcdcb12cf32621889.tar.bz2 cygnal-e2ea684e4ecca39aae13d3cdcdcb12cf32621889.zip |
* 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.cc | 15 |
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); |