diff options
author | Christopher Faylor <me@cgf.cx> | 2000-03-09 21:04:05 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-03-09 21:04:05 +0000 |
commit | af1dc7ccea4e312010198981382bd1e33910eccb (patch) | |
tree | 0a4548c063598f1674c9cd9eafa5232ab5009d6d /winsup/cygwin/fhandler_tty.cc | |
parent | 3072163c0fc1304bfa93ba950d8747c8456fca05 (diff) | |
download | cygnal-af1dc7ccea4e312010198981382bd1e33910eccb.tar.gz cygnal-af1dc7ccea4e312010198981382bd1e33910eccb.tar.bz2 cygnal-af1dc7ccea4e312010198981382bd1e33910eccb.zip |
* environ.cc: Eliminate oldstack CYGWIN option.
* exceptions.cc (sfta): Eliminate obsolete function.
(sgmb): Eliminate obsolete function.
(class stack_info): Remove MS method for walking the stack.
(stack_info::init): Just initialize required fields.
(stack_info::brute_force): Rename to stack_info::walk.
(handle_exceptions): Pass derived frame pointer to sig_send.
(interrupt_setup): Clear saved frame pointer here.
(interrupt_on_return): thestack is no longer a pointer.
(call_handler): Accept a flag to indicate when a signal was sent from other
than the main thread. Use saved frame pointer for determining where to place
signal handler call.
(sig_handle): Accept "nonmain" argument. Pass it to call_handler.
* fhandler_tty.cc (fhandler_tty_common::__acquire_output_mutex): Change
debugging output slightly.
* (fhandler_tty_common::__release_output_mutex): Ditto.
(fhandler_tty_slave::read): Fix a comment, remove a goto.
* sigproc.cc (sig_send): Accept an optional frame pointer argument for use when
suspending the main process. sigcomplete_main is an autoreset event now. Save
frame pointer for non-main operation.
(wait_sig): Make sigcomplete_main an autoreset event. Eliminate NOSIGQUEUE.
Pass rc to sig_handle to signify if this was a nonmain process.
* sigproc.h: Reflect change to sig_send argument.
* syscalls.cc (swab): Eliminate swab function since it is now available in
newlib.
* winsup.h (signal_dispatch): Change CONTEXT cx to DWORD ebp.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index 0e6a6edc1..3261ea2ce 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -110,7 +110,10 @@ fhandler_tty_common::__acquire_output_mutex (const char *fn, int ln, DWORD res = WaitForSingleObject (output_mutex, ms); if (res == WAIT_OBJECT_0) { -#ifdef DEBUGGING +#ifndef DEBUGGING + if (strace.active) + strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex: acquired", fn, ln, res); +#else ostack[osi].fn = fn; ostack[osi].ln = ln; ostack[osi].tname = threadname (0, 0); @@ -118,8 +121,6 @@ fhandler_tty_common::__acquire_output_mutex (const char *fn, int ln, osi++; #endif } - if (strace.active) - strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex: acquired", fn, ln, res); return res; } @@ -128,7 +129,10 @@ fhandler_tty_common::__release_output_mutex (const char *fn, int ln) { if (ReleaseMutex (output_mutex)) { -#ifdef DEBUGGING +#ifndef DEBUGGING + if (strace.active) + strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex released", fn, ln); +#else if (osi > 0) osi--; termios_printf ("released at %s:%d, osi %d", fn, ln, osi); @@ -136,8 +140,6 @@ fhandler_tty_common::__release_output_mutex (const char *fn, int ln) ostack[osi].ln = -ln; #endif } - if (strace.active) - strace.prntf (_STRACE_TERMIOS, "%F (%d): tty output_mutex released", fn, ln); } #define acquire_output_mutex(ms) \ @@ -288,7 +290,10 @@ again: } if (get_ttyp ()->OutputStopped) - WaitForSingleObject (restart_output_event, INFINITE); + { + termios_printf ("waiting for restart_output_event"); + WaitForSingleObject (restart_output_event, INFINITE); + } if (get_ttyp ()->ti.c_oflag & OPOST) // post-process output { @@ -575,7 +580,6 @@ fhandler_tty_slave::read (void *ptr, size_t len) while (len) { - wait: termios_printf ("reading %d bytes (vtime %d)", min ((unsigned) vmin, min (len, sizeof (buf))), vtime); if (ReadFile (get_handle (), (unsigned *) buf, @@ -614,7 +618,7 @@ fhandler_tty_slave::read (void *ptr, size_t len) if (get_flags () & (O_NONBLOCK | O_NDELAY)) break; - /* We can't enter to blocking Readfile - signals will be lost! + /* We can't enter the blocking Readfile as signals will be lost. * So, poll the pipe for data. * FIXME: try to avoid polling... * FIXME: Current EINTR scheme does not take vmin/vtime into account. @@ -625,7 +629,7 @@ fhandler_tty_slave::read (void *ptr, size_t len) if (vmin == 0 && vtime == 0) return 0; // min = 0, time = 0 if (vtime == 0) - goto wait; // min > 0, time = 0 + continue; // min > 0, time = 0 while (vtime--) { PeekNamedPipe (get_handle (), NULL, 0, NULL, &n, NULL); |