From c1644acb233ed749b28b4139604ab134cf1cd34c Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 7 Sep 2000 01:18:37 +0000 Subject: * exceptions.cc (signal_exit): Reset all mutos owned by the main thread. * fhandler.h: Define *_output_mutex macros for serializing tty output. (fhandler_termios): Remove restart_output_event. Define dummy output mutex methods. (fhandler_pty_master): Remove unneeded fixup_after_fork method. * fhandler_termios.cc (fhandler_termios::line_edit): Acquire output_mutex when CTRL-S is hit. Release it on CTRL-Q. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Remove inappropriate OutputStopped test here. Just use the output mutex. (fhandler_pty_master::fhandler_pty_master): Remove obsolete reference to restart_output_event. (fhandler_tty_common::close): Ditto. (fhandler_pty_master::set_close_on_exec): Ditto. (fhandler_pty_master::fixup_after_fork): Delete. * tty.cc (tty::common_init): Ditto. * sync.cc (muto::reset): New method. * sync.h: Declare above method. --- winsup/cygwin/fhandler.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index 10807ceb2..a7f942a7e 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -505,6 +505,12 @@ public: int ready_for_read (int fd, DWORD howlong, int ignra); }; +#define acquire_output_mutex(ms) \ + __acquire_output_mutex (__PRETTY_FUNCTION__, __LINE__, ms); + +#define release_output_mutex() \ + __release_output_mutex (__PRETTY_FUNCTION__, __LINE__); + class fhandler_termios: public fhandler_base { protected: @@ -518,7 +524,6 @@ public: { // nothing to do } - HANDLE restart_output_event; HANDLE get_output_handle () const { return output_handle; } int line_edit (const char *rptr, int nread, int always_accept = 0); void set_output_handle (HANDLE h) { output_handle = h; } @@ -528,6 +533,8 @@ public: int tcsetpgrp (int pid); void set_ctty (int ttynum, int flags); int bg_check (int sig); + virtual DWORD __acquire_output_mutex (const char *fn, int ln, DWORD ms) {return 1;} + virtual void __release_output_mutex (const char *fn, int ln) {} }; /* This is a input and output console handle */ @@ -692,7 +699,6 @@ public: char *ptsname (); void set_close_on_exec (int val); - void fixup_after_fork (HANDLE parent); BOOL hit_eof (); }; -- cgit v1.2.3