summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2007-02-23 15:49:23 +0000
committerChris Wilson <cpwilson@src.gnome.org>2007-02-23 15:49:23 +0000
commit3bad172349963d030ffcacca90585fb9b3b93bcd (patch)
tree81d5f5d4840c545c1b482321abf08c16ab9b8fef
parent713bb7322e8e012deccabe331b21a5b9a60864ba (diff)
downloadvte-3bad172349963d030ffcacca90585fb9b3b93bcd.tar.gz
Heuristic to avoid a read when it's likely to just return EAGAIN.
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: * src/vte.c: (vte_terminal_io_read), (process_timeout), (update_repeat_timeout), (update_timeout): svn path=/trunk/; revision=1730
-rw-r--r--ChangeLog8
-rw-r--r--src/vte-private.h1
-rw-r--r--src/vte.c23
3 files changed, 26 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 077b0b12..2d80c304 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
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:
+ * src/vte.c: (vte_terminal_io_read), (process_timeout),
+ (update_repeat_timeout), (update_timeout):
+
+2007-02-23 Chris Wilson <chris@chris-wilson.co.uk>
+
Add a new debug flag to monitor draw operations.
Don't issue individual glyphs for is_local_graphic() in the middle of
a run.
diff --git a/src/vte-private.h b/src/vte-private.h
index 3e3d6f43..192ba0cd 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -171,6 +171,7 @@ struct _VteTerminalPrivate {
int pty_master; /* pty master descriptor */
GIOChannel *pty_input; /* master input watch */
guint pty_input_source;
+ gboolean pty_input_active;
GIOChannel *pty_output; /* master output watch */
guint pty_output_source;
GPid pty_pid; /* pid of child using pty slave */
diff --git a/src/vte.c b/src/vte.c
index d73a538a..86aeeda4 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -3495,6 +3495,7 @@ out:
vte_terminal_add_process_timeout (terminal);
GDK_THREADS_LEAVE ();
}
+ terminal->pvt->pty_input_active = TRUE;
}
/* Error? */
@@ -11760,8 +11761,12 @@ process_timeout (gpointer data)
_vte_debug_print (VTE_DEBUG_WORK, "T");
}
if (terminal->pvt->pty_input) {
- vte_terminal_io_read(terminal->pvt->pty_input,
- G_IO_IN, terminal);
+ if (terminal->pvt->pty_input_active ||
+ terminal->pvt->pty_input_source == VTE_INVALID_SOURCE) {
+ vte_terminal_io_read(terminal->pvt->pty_input,
+ G_IO_IN, terminal);
+ terminal->pvt->pty_input_active = FALSE;
+ }
}
again = FALSE;
if (need_processing (terminal)) do {
@@ -11871,8 +11876,11 @@ update_repeat_timeout (gpointer data)
}
if (terminal->pvt->pty_input) {
- vte_terminal_io_read (terminal->pvt->pty_input,
- G_IO_IN, terminal);
+ if (terminal->pvt->pty_input_active ||
+ terminal->pvt->pty_input_source == VTE_INVALID_SOURCE) {
+ vte_terminal_io_read (terminal->pvt->pty_input,
+ G_IO_IN, terminal);
+ }
}
again = TRUE;
while (again && need_processing (terminal)) {
@@ -11957,8 +11965,11 @@ update_timeout (gpointer data)
_vte_debug_print (VTE_DEBUG_WORK, "T");
}
if (terminal->pvt->pty_input) {
- vte_terminal_io_read(terminal->pvt->pty_input,
- G_IO_IN, terminal);
+ if (terminal->pvt->pty_input_active ||
+ terminal->pvt->pty_input_source == VTE_INVALID_SOURCE) {
+ vte_terminal_io_read(terminal->pvt->pty_input,
+ G_IO_IN, terminal);
+ }
}
again = TRUE;
while (again && need_processing (terminal)) {