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:
authorCorinna Vinschen <corinna@vinschen.de>2010-05-26 17:10:55 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-05-26 17:10:55 +0400
commit403ab0c013eaff67b332c917109b36a787c447f2 (patch)
tree4eca903bf2c1fd500b9fde4ededf790f2bf4e278 /winsup
parent60321a0733673e54fa09fbcfe4bdc29387389fdb (diff)
* fhandler.h (class fhandler_pty_master): Add master_thread member.
* fhandler_tty.cc (fhandler_pty_master::close): Properly detach from master thread. (fhandler_pty_master::setup): Store cygthread pointer of pty master control thread in master_thread. Don't zap thread handle.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/fhandler.h1
-rw-r--r--winsup/cygwin/fhandler_tty.cc7
3 files changed, 12 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 1e274ff2a..bcc97301d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-26 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler.h (class fhandler_pty_master): Add master_thread member.
+ * fhandler_tty.cc (fhandler_pty_master::close): Properly detach from
+ master thread.
+ (fhandler_pty_master::setup): Store cygthread pointer of pty master
+ control thread in master_thread. Don't zap thread handle.
+
2010-05-26 Kazuhiro Fujieda <fujieda@acm.org>
Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 1255a3fb9..cce11aada 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1125,6 +1125,7 @@ class fhandler_pty_master: public fhandler_tty_common
{
int pktmode; // non-zero if pty in a packet mode.
HANDLE master_ctl; // Control socket for handle duplication
+ cygthread *master_thread; // Master control thread
public:
int need_nl; // Next read should start with \n
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 8a0cfb415..cd931be54 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1429,6 +1429,7 @@ fhandler_pty_master::close ()
&installation_key, get_unit ());
CallNamedPipe (buf, &req, sizeof req, &repl, sizeof repl, &len, 500);
CloseHandle (arch->master_ctl);
+ arch->master_thread->detach ();
}
if (!ForceCloseHandle (arch->from_master))
termios_printf ("error closing from_master %p, %E", arch->from_master);
@@ -1802,7 +1803,6 @@ fhandler_pty_master::setup (bool ispty)
{
/* Create master control pipe which allows the master to duplicate
the pty pipe handles to processes which deserve it. */
- cygthread *h;
__small_sprintf (buf, "\\\\.\\pipe\\cygwin-%S-tty%d-master-ctl",
&installation_key, get_unit ());
master_ctl = CreateNamedPipe (buf, PIPE_ACCESS_DUPLEX,
@@ -1814,13 +1814,12 @@ fhandler_pty_master::setup (bool ispty)
errstr = "pty master control pipe";
goto err;
}
- h = new cygthread (::pty_master_thread, 0, this, "pty_master");
- if (!h)
+ master_thread = new cygthread (::pty_master_thread, 0, this, "pty_master");
+ if (!master_thread)
{
errstr = "pty master control thread";
goto err;
}
- h->zap_h ();
}
t.from_master = from_master;