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/sync.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'winsup/cygwin/sync.cc') diff --git a/winsup/cygwin/sync.cc b/winsup/cygwin/sync.cc index f5c21594b..9f44ff264 100644 --- a/winsup/cygwin/sync.cc +++ b/winsup/cygwin/sync.cc @@ -125,3 +125,16 @@ muto::release () return 1; /* success. */ } + +/* Call only when we're exiting. This is not thread safe. */ +void +muto::reset () +{ + visits = sync = tid = 0; + InterlockedExchange (&waiters, -1); + if (bruteforce) + { + CloseHandle (bruteforce); + bruteforce = CreateEvent (&sec_none_nih, FALSE, FALSE, name); + } +} -- cgit v1.2.3