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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-12-06 00:29:37 +0300
committerChristopher Faylor <me@cgf.cx>2004-12-06 00:29:37 +0300
commitf181da27079a1f4838e2b4fc88bfab3a92b0a696 (patch)
tree9ada6d977ce88152e05a44d471d6d1d1cfa4c824 /winsup
parent54dd79bb44d2180ab769558deab274c70391cca7 (diff)
* cygthread.cc (cygthread::terminate_thread): Make public.
* pinfo.h (pinfo::wait_thread): New element. * pinfo.cc (pinfo::wait): Store "handle" to started thread in pinfo. * sigproc.cc (proc_terminate): Kill any threads waiting for a process pipe.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/cygthread.h2
-rw-r--r--winsup/cygwin/pinfo.cc2
-rw-r--r--winsup/cygwin/pinfo.h1
-rw-r--r--winsup/cygwin/sigproc.cc5
5 files changed, 16 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 74423f2f4..e6986dcce 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2004-12-05 Christopher Faylor <cgf@timesys.com>
+ * cygthread.cc (cygthread::terminate_thread): Make public.
+ * pinfo.h (pinfo::wait_thread): New element.
+ * pinfo.cc (pinfo::wait): Store "handle" to started thread in pinfo.
+ * sigproc.cc (proc_terminate): Kill any threads waiting for a process
+ pipe.
+
+2004-12-05 Christopher Faylor <cgf@timesys.com>
+
* sigproc.cc (mychild): Reimplement as list scan.
(proc_subproc): Don't mess with pinfo if it's myself.
diff --git a/winsup/cygwin/cygthread.h b/winsup/cygwin/cygthread.h
index dfeef90de..4517b9232 100644
--- a/winsup/cygwin/cygthread.h
+++ b/winsup/cygwin/cygthread.h
@@ -22,8 +22,8 @@ class cygthread
VOID *arg;
bool is_freerange;
static bool exiting;
- void terminate_thread ();
public:
+ void terminate_thread ();
static DWORD WINAPI stub (VOID *);
static DWORD WINAPI simplestub (VOID *);
static DWORD main_thread_id;
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index ebc6d07b9..8d6a7dafa 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -833,7 +833,7 @@ pinfo::wait ()
sigproc_printf ("tracking thread creation failed for pid %d", (*this)->pid);
else
{
- h->zap_h ();
+ wait_thread = h;
sigproc_printf ("created tracking thread for pid %d, winpid %p, rd_pipe %p",
(*this)->pid, (*this)->dwProcessId, rd_proc_pipe);
}
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index c249fe174..e460eed65 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -137,6 +137,7 @@ public:
CRITICAL_SECTION _lock;
/* Handle associated with initial Windows pid which started it all. */
HANDLE pid_handle;
+ class cygthread *wait_thread;
void init (pid_t, DWORD, HANDLE = NULL) __attribute__ ((regparm(3)));
pinfo () {}
pinfo (_pinfo *x): procinfo (x), hProcess (NULL), pid_handle (NULL) {}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index d7c57b1d2..bc1d6fff6 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -401,6 +401,11 @@ proc_terminate (void)
procs[i]->ppid = 1;
if (!proc_exists (procs[i]))
procs[i]->process_state = PID_EXITED; /* CGF FIXME - still needed? */
+ if (procs[i].wait_thread)
+ {
+ // CloseHandle (procs[i].rd_proc_pipe);
+ procs[i].wait_thread->terminate_thread ();
+ }
procs[i].release ();
}
nprocs = 0;