]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler.h (class fhandler_pty_master): Add master_thread member.
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 26 May 2010 13:10:55 +0000 (13:10 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 26 May 2010 13:10:55 +0000 (13:10 +0000)
* 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.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler.h
winsup/cygwin/fhandler_tty.cc

index 1e274ff2a55996534b11dfa19281688d4d2c316f..bcc97301d3688ed0b89de837e5ec9cdb283b6312 100644 (file)
@@ -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>
 
index 1255a3fb9f4652edafbaa5b18ec0596fcf3e7d9d..cce11aadad473419349090a24c33ef0484db9427 100644 (file)
@@ -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
index 8a0cfb415e4f605d91121095ce8bec89441c2356..cd931be54c602e61b3173cb11ea22eddfc4740c1 100644 (file)
@@ -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;
This page took 0.04044 seconds and 5 git commands to generate.