emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117420: Avoid 100% CPU utilization on ssh sessio


From: Paul Eggert
Subject: [Emacs-diffs] emacs-24 r117420: Avoid 100% CPU utilization on ssh session exit.
Date: Sat, 02 Aug 2014 21:31:23 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117420
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17691
committer: Paul Eggert <address@hidden>
branch nick: emacs-24
timestamp: Sat 2014-08-02 14:31:18 -0700
message:
  Avoid 100% CPU utilization on ssh session exit.
  
  * src/xterm.h (struct x_display_info): New member 'connection'.
  * src/xterm.c (x_term_init, x_delete_terminal): Set and use it,
  so that x_delete_terminal has a file descriptor to pass to
  delete_keyboard_wait_descriptor.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
  src/xterm.h                    xterm.h-20091113204419-o5vbwnq5f7feedwu-228
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-08-01 09:39:04 +0000
+++ b/src/ChangeLog     2014-08-02 21:31:18 +0000
@@ -1,3 +1,11 @@
+2014-08-02  Paul Eggert  <address@hidden>
+
+       Avoid 100% CPU utilization on ssh session exit (Bug#17691).
+       * xterm.h (struct x_display_info): New member 'connection'.
+       * xterm.c (x_term_init, x_delete_terminal): Set and use it,
+       so that x_delete_terminal has a file descriptor to pass to
+       delete_keyboard_wait_descriptor.
+
 2014-08-01  Eli Zaretskii  <address@hidden>
 
        Fix display of R2L lines when the last character fits only partially.

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2014-06-01 18:00:56 +0000
+++ b/src/xterm.c       2014-08-02 21:31:18 +0000
@@ -9932,6 +9932,7 @@
 
   dpyinfo->name_list_element = Fcons (display_name, Qnil);
   dpyinfo->display = dpy;
+  dpyinfo->connection = ConnectionNumber (dpyinfo->display);
 
   /* Set the name of the terminal. */
   terminal->name = xlispstrdup (display_name);
@@ -10360,7 +10361,6 @@
 x_delete_terminal (struct terminal *terminal)
 {
   struct x_display_info *dpyinfo = terminal->display_info.x;
-  int connection = -1;
 
   /* Protect against recursive calls.  delete_frame in
      delete_terminal calls us back when it deletes our last frame.  */
@@ -10379,8 +10379,6 @@
      and dpyinfo->display was set to 0 to indicate that.  */
   if (dpyinfo->display)
     {
-      connection = ConnectionNumber (dpyinfo->display);
-
       x_destroy_all_bitmaps (dpyinfo);
       XSetCloseDownMode (dpyinfo->display, DestroyAll);
 
@@ -10422,11 +10420,12 @@
     }
 
   /* No more input on this descriptor.  */
-  if (connection != -1)
-    delete_keyboard_wait_descriptor (connection);
+  if (0 <= dpyinfo->connection)
+    delete_keyboard_wait_descriptor (dpyinfo->connection);
 
   /* Mark as dead. */
   dpyinfo->display = NULL;
+  dpyinfo->connection = -1;
   x_delete_display (dpyinfo);
   unblock_input ();
 }

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2014-03-03 08:27:58 +0000
+++ b/src/xterm.h       2014-08-02 21:31:18 +0000
@@ -137,6 +137,9 @@
   /* This says how to access this display in Xlib.  */
   Display *display;
 
+  /* A connection number (file descriptor) for the display.  */
+  int connection;
+
   /* This is a cons cell of the form (NAME . FONT-LIST-CACHE).  */
   Lisp_Object name_list_element;
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]