aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-06-08 14:42:44 +0000
committerChristopher Faylor <me@cgf.cx>2013-06-08 14:42:44 +0000
commit1eaf9215cb27dc368598e5937533411c360fddc9 (patch)
treea20b6405601b4f951cdec4fe515268e702999d02 /winsup
parent5d35299e5102d92a995cf5aabd0fafa5b96a2c90 (diff)
downloadnewlib-1eaf9215cb27dc368598e5937533411c360fddc9.zip
newlib-1eaf9215cb27dc368598e5937533411c360fddc9.tar.gz
newlib-1eaf9215cb27dc368598e5937533411c360fddc9.tar.bz2
revert accidentally checked in files
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler_tty.cc5
-rw-r--r--winsup/cygwin/miscfuncs.cc6
2 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5efbf43..34c8795 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -96,7 +96,7 @@ fhandler_pty_common::__acquire_output_mutex (const char *fn, int ln,
{
if (strace.active ())
strace.prntf (_STRACE_TERMIOS, fn, "(%d): pty output_mutex (%p): waiting %d ms", ln, output_mutex, ms);
- if (0 && ms == INFINITE)
+ if (ms == INFINITE)
ms = 100;
DWORD res = WaitForSingleObject (output_mutex, ms);
if (res == WAIT_OBJECT_0)
@@ -145,9 +145,6 @@ fhandler_pty_common::__release_output_mutex (const char *fn, int ln)
void
fhandler_pty_master::doecho (const void *str, DWORD len)
{
- static char buf[128 * 1024];
- int buflen = process_slave_output (buf, sizeof (buf), false);
- puts_readahead (buf, buflen);
acquire_output_mutex (INFINITE);
if (!WriteFile (to_master, str, len, &len, NULL))
termios_printf ("Write to %p failed, %E", to_master);
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index c2b405e..d0748ea 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -251,8 +251,10 @@ yield ()
/* MSDN implies that SleepEx will force scheduling of other threads.
Unlike SwitchToThread() the documentation does not mention other
cpus so, presumably (hah!), this + using a lower priority will
- stall this thread temporarily and cause another to run. */
- SleepEx (0L, false);
+ stall this thread temporarily and cause another to run.
+ Note: Don't use 0 timeout. This takes a lot of CPU if something
+ goes wrong. */
+ SleepEx (1L, false);
}
SetThreadPriority (GetCurrentThread (), prio);
}