summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-02-23 16:10:30 +0000
committerChris Wilson <cpwilson@src.gnome.org>2007-02-23 16:10:30 +0000
commit728c62c88fd6475ba02f07a36672a26431d1eda0 (patch)
tree26582ab06bf24fae0a3965903074448aa12901df
parent0e510fe7354ac3987f0c0b10521768063eb40560 (diff)
downloadvte-728c62c88fd6475ba02f07a36672a26431d1eda0.tar.gz
Prevent a deadlock on recursively grabbing the gdk_mutex.
2007-02-23 Chris Wilson <chris@chris-wilson.co.uk> * src/vte.c: (vte_terminal_io_read): Prevent a deadlock on recursively grabbing the gdk_mutex. svn path=/trunk/; revision=1733
-rw-r--r--ChangeLog5
-rw-r--r--src/vte.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d80c304..07cbbc45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-02-23 Chris Wilson <chris@chris-wilson.co.uk>
+ * src/vte.c: (vte_terminal_io_read):
+ Prevent a deadlock on recursively grabbing the gdk_mutex.
+
+2007-02-23 Chris Wilson <chris@chris-wilson.co.uk>
+
Heuristic to avoid a read when it's likely to just return EAGAIN.
* src/vte-private.h:
diff --git a/src/vte.c b/src/vte.c
index 79d0051d..26844a84 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -3519,9 +3519,14 @@ out:
/* If we detected an eof condition, signal one. */
if (eof) {
- GDK_THREADS_ENTER ();
- vte_terminal_eof (channel, terminal);
- GDK_THREADS_LEAVE ();
+ /* potential deadlock ... */
+ if (!vte_terminal_is_processing (terminal)) {
+ GDK_THREADS_ENTER ();
+ vte_terminal_eof (channel, terminal);
+ GDK_THREADS_LEAVE ();
+ } else {
+ vte_terminal_eof (channel, terminal);
+ }
}
return !eof && (!active_terminals || !active_terminals->next);