aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-10-24 15:26:05 +0000
committerChristopher Faylor <me@cgf.cx>2010-10-24 15:26:05 +0000
commit488ddaced31b6e5c022732588375ddf6281b1c1a (patch)
tree2b7ecd53d9431bdc29b45ae3637f05558388a93e
parentc4f296c2a9cc3c860cf5610188205e22e0277621 (diff)
downloadnewlib-488ddaced31b6e5c022732588375ddf6281b1c1a.zip
newlib-488ddaced31b6e5c022732588375ddf6281b1c1a.tar.gz
newlib-488ddaced31b6e5c022732588375ddf6281b1c1a.tar.bz2
* exceptions.cc (try_to_debug): Improve comment.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Add a comment.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/exceptions.cc5
-rw-r--r--winsup/cygwin/fhandler_tty.cc8
3 files changed, 13 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 76b2d42..554d14f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-24 Christopher Faylor <me+cygwin@cgf.cx>
+
+ * exceptions.cc (try_to_debug): Improve comment.
+ * fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Add a
+ comment.
+
2010-10-23 Christopher Faylor <me+cygwin@cgf.cx>
* pinfo.cc (pinfo::exit): Grab a tty lock before setting pgid.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index db18f7a..7176657 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -390,8 +390,9 @@ try_to_debug (bool waitloop)
suspend_all_threads_except (current_thread_id);
*/
- /* if any of these mutexes is owned, we will fail to start any cygwin app
- until trapped app exits */
+ /* If the tty mutex is owned, we will fail to start any cygwin app
+ until the trapped app exits. However, this will only release any
+ the mutex if it is owned by this thread so that may be problematic. */
lock_ttys::release ();
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index f2616e7..56ef280 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1347,8 +1347,8 @@ fhandler_pty_master::fhandler_pty_master ()
int
fhandler_pty_master::open (int flags, mode_t)
{
- int ntty;
- ntty = cygwin_shared->tty.allocate (false);
+ /* Note that allocate returns with the tty lock set if it was successful. */
+ int ntty = cygwin_shared->tty.allocate (false);
if (ntty < 0)
return 0;
@@ -1361,8 +1361,8 @@ fhandler_pty_master::open (int flags, mode_t)
lock_ttys::release ();
set_flags ((flags & ~O_TEXT) | O_BINARY);
set_open_status ();
- //
- // FIXME: Do this better someday
+
+ /* FIXME: Do this better someday */
fhandler_pty_master *arch = (fhandler_tty_master *) cmalloc_abort (HEAP_ARCHETYPES, sizeof (*this));
*((fhandler_pty_master **) cygheap->fdtab.add_archetype ()) = arch;
archetype = arch;