diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-12-14 17:19:22 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-12-14 17:19:22 +0000 |
commit | dad3ae73b314dd586a4ba56608c927ba91dda03a (patch) | |
tree | fda2e273074c16d7dbcfb129b04181d00a69436a | |
parent | 988566db0c056ca34fa43c0d041311d3f14e1009 (diff) | |
download | newlib-dad3ae73b314dd586a4ba56608c927ba91dda03a.zip newlib-dad3ae73b314dd586a4ba56608c927ba91dda03a.tar.gz newlib-dad3ae73b314dd586a4ba56608c927ba91dda03a.tar.bz2 |
* tty.cc (tty_list::terminate): Guard releasing the tty with tty_mutex.
(tty::init): Set master_pid to 0.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/tty.cc | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 41bacc9..67d9664 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2004-12-14 Corinna Vinschen <corinna@vinschen.de> + + * tty.cc (tty_list::terminate): Guard releasing the tty with tty_mutex. + (tty::init): Set master_pid to 0. + 2004-12-14 Thomas Wolff <towo@computer.org> * fhandler_console.cc (read): Consider offset within scrolling diff --git a/winsup/cygwin/tty.cc b/winsup/cygwin/tty.cc index ef77bd5..e2883fe 100644 --- a/winsup/cygwin/tty.cc +++ b/winsup/cygwin/tty.cc @@ -151,6 +151,9 @@ tty_list::terminate (void) low_priority_sleep (200); } + if (WaitForSingleObject (tty_mutex, INFINITE) == WAIT_FAILED) + termios_printf ("WFSO for tty_mutex %p failed, %E", tty_mutex); + termios_printf ("tty %d master about to finish", ttynum); ForceCloseHandle1 (t->to_slave, to_pty); ForceCloseHandle1 (t->from_slave, from_pty); @@ -160,6 +163,8 @@ tty_list::terminate (void) char buf[20]; __small_sprintf (buf, "tty%d", ttynum); logout (buf); + + ReleaseMutex (tty_mutex); } } @@ -369,6 +374,7 @@ tty::init (void) to_slave = NULL; from_slave = NULL; was_opened = 0; + master_pid = 0; } HANDLE |