* fhandler_termios.cc (fhandler_termios::line_edit): Don't manipulate

output_mutex on CTRL-S/CTRL-Q to avoid a deadlock.
* fhandler_tty.cc (fhandler_pty_slave::write): Loop when output_stopped is
detected before acquiring output_mutex.  Acquire output_mutex in the loop for
each write.
* tty.h: Remove some obsolete defines.
(tty_min::output_stopped): Make 'bool'.
This commit is contained in:
Christopher Faylor
2012-10-12 01:19:04 +00:00
parent 52985c1686
commit fe0cb31137
4 changed files with 24 additions and 16 deletions

View File

@@ -19,12 +19,10 @@ details. */
/* Input/Output/ioctl events */
#define RESTART_OUTPUT_EVENT "cygtty.output.restart"
#define INPUT_AVAILABLE_EVENT "cygtty.input.avail"
#define OUTPUT_MUTEX "cygtty.output.mutex"
#define INPUT_MUTEX "cygtty.input.mutex"
#define TTY_SLAVE_ALIVE "cygtty.slave_alive"
#define TTY_MASTER_ALIVE "cygtty.master_alive"
#include <sys/termios.h>
@@ -38,15 +36,15 @@ class tty_min
pid_t sid; /* Session ID of tty */
struct status_flags
{
unsigned initialized : 1; /* Set if tty is initialized */
unsigned rstcons : 1; /* Set if console needs to be set to "non-cooked" */
unsigned initialized : 1; /* Set if tty is initialized */
unsigned rstcons : 1; /* Set if console needs to be set to "non-cooked" */
} status;
public:
pid_t pgid;
int output_stopped;
bool output_stopped; /* FIXME: Maybe do this with a mutex someday? */
fh_devices ntty;
DWORD last_ctrl_c; /* tick count of last ctrl-c */
DWORD last_ctrl_c; /* tick count of last ctrl-c */
bool is_console;
IMPLEMENT_STATUS_FLAG (bool, initialized)