summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_tty.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-05-08 00:10:08 +0000
committerChristopher Faylor <me@cgf.cx>2013-05-08 00:10:08 +0000
commiteeec3bebbc4d741ed5f1af0fc3cb947aa25d43b2 (patch)
tree83b4accd347d033cf69854415e3f55096c6c6025 /winsup/cygwin/fhandler_tty.cc
parent6bd6954bdc0f3fc4c952f8066e939f16c69bf13b (diff)
downloadcygnal-eeec3bebbc4d741ed5f1af0fc3cb947aa25d43b2.tar.gz
cygnal-eeec3bebbc4d741ed5f1af0fc3cb947aa25d43b2.tar.bz2
cygnal-eeec3bebbc4d741ed5f1af0fc3cb947aa25d43b2.zip
* fhandler_tty.cc (fhandler_pty_common::__acquire_output_mutex): Never wait an
INFINITE amount of time. Instead default to 1/10 second. (fhandler_pty_slave::open): Just default to INFINITE wait rather than (now) waiting longer than previously.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 5949d0526..34c879503 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -96,6 +96,8 @@ 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 (ms == INFINITE)
+ ms = 100;
DWORD res = WaitForSingleObject (output_mutex, ms);
if (res == WAIT_OBJECT_0)
{
@@ -435,7 +437,7 @@ fhandler_pty_slave::open (int flags, mode_t)
S_IFCHR | S_IRUSR | S_IWUSR | S_IWGRP,
sd))
sa.lpSecurityDescriptor = (PSECURITY_DESCRIPTOR) sd;
- acquire_output_mutex (500);
+ acquire_output_mutex (INFINITE);
inuse = get_ttyp ()->create_inuse (&sa);
get_ttyp ()->was_opened = true;
release_output_mutex ();