* pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid.

This commit is contained in:
Christopher Faylor 2010-10-23 18:57:43 +00:00
parent 74882a259a
commit c4f296c2a9
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
* pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid.
2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
* pinfo.cc (pinfo::exit): Reset tty pgrp to zero if no more handles open.

View File

@ -188,6 +188,7 @@ pinfo::exit (DWORD n)
sigproc_terminate (ES_FINAL);
if (myself->ctty >= 0 && myself->ctty != TTY_CONSOLE)
{
lock_ttys here;
tty *t = cygwin_shared->tty[myself->ctty];
if (!t->slave_alive ())
t->setpgid (0);