summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <cgf@redhat.com>2004-11-20 04:17:22 +0000
committerChristopher Faylor <cgf@redhat.com>2004-11-20 04:17:22 +0000
commitaff6eb87fc8eb739e535774d5e0abb1e75899573 (patch)
tree0ffd51981fa2e4e223c21e658f86be1f5d487d00
parent44e23aaa8426e878c98e48706f1bd2b85ecd4656 (diff)
downloadgdb-aff6eb87fc8eb739e535774d5e0abb1e75899573.tar.gz
unexperiment
-rw-r--r--winsup/cygwin/pinfo.cc28
-rw-r--r--winsup/cygwin/sigproc.cc10
2 files changed, 10 insertions, 28 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index b2f03bf2c6c..781df96d004 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -125,22 +125,18 @@ _pinfo::exit (UINT n, bool norecord)
if (this)
{
- if (!norecord)
- {
- process_state = PID_EXITED;
- if (CGFFAST && myself->ppid != 1)
- {
- pinfo parent (myself->ppid);
- if (parent)
- sig_send (parent, SIGCHLD);
- }
- }
-
/* FIXME: There is a potential race between an execed process and its
parent here. I hated to add a mutex just for this, though. */
struct rusage r;
fill_rusage (&r, hMainProc);
add_rusage (&rusage_self, &r);
+
+ if (!norecord)
+ {
+ process_state = PID_EXITED;
+ if (wr_proc_pipe)
+ CloseHandle (wr_proc_pipe);
+ }
}
sigproc_printf ("Calling ExitProcess %d", n);
@@ -766,14 +762,6 @@ pinfo::wait ()
preserve ();
-#if 0
- DWORD tid;
- HANDLE h = CreateThread (&sec_none_nih, 0, proc_waiter, this, 0, &tid);
- if (!h)
- sigproc_printf ("tracking thread creation failed for pid %d", (*this)->pid);
- else
- CloseHandle (h);
-#else
cygthread *h = new cygthread (proc_waiter, this, "sig");
if (!h)
sigproc_printf ("tracking thread creation failed for pid %d", (*this)->pid);
@@ -783,7 +771,7 @@ pinfo::wait ()
sigproc_printf ("created tracking thread for pid %d, winpid %p, rd_pipe %p",
(*this)->pid, (*this)->dwProcessId, rd_proc_pipe);
}
-#endif
+
return 1;
}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 15ffbcfef7d..8dc55972e44 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -274,13 +274,7 @@ proc_subproc (DWORD what, DWORD val)
vchild->cygstarted = true;
vchild->process_state |= PID_INITIALIZING | (myself->process_state & PID_USETTY);
procs[nprocs] = vchild;
- if (!CGFFAST)
- rc = procs[nprocs].wait ();
- else
- {
- procs[nprocs].preserve ();
- rc = 1;
- }
+ rc = procs[nprocs].wait ();
if (rc)
{
sigproc_printf ("added pid %d to proc table, slot %d", vchild->pid,
@@ -803,7 +797,7 @@ stopped_or_terminated (waitq *parent_w, _pinfo *child)
int terminated;
- if (!((terminated = (child->process_state == PID_ZOMBIE | child->process_state == PID_EXITED)) ||
+ if (!((terminated = (child->process_state == PID_ZOMBIE)) ||
((w->options & WUNTRACED) && child->stopsig)))
return 0;