Patch 8.2.4595
Problem:    X11: using --remote-wait may keep the CPU busy.
Solution:   Set the timeout for select() on every call. (Jacopo Secchiero,
            closes #9973)
Files:      src/if_xcmdsrv.c


*** ../vim-8.2.4594/src/if_xcmdsrv.c    2022-01-02 21:26:12.315264334 +0000
--- src/if_xcmdsrv.c    2022-03-20 11:02:23.615813325 +0000
***************
*** 556,574 ****
  
  #define UI_MSEC_DELAY 53
  #define SEND_MSEC_POLL 500
! #ifndef HAVE_SELECT
!     struct pollfd   fds;
! 
!     fds.fd = ConnectionNumber(dpy);
!     fds.events = POLLIN;
! #else
      fd_set        fds;
-     struct timeval  tv;
  
-     tv.tv_sec = 0;
-     tv.tv_usec =  SEND_MSEC_POLL * 1000;
      FD_ZERO(&fds);
      FD_SET(ConnectionNumber(dpy), &fds);
  #endif
  
      time(&start);
--- 556,571 ----
  
  #define UI_MSEC_DELAY 53
  #define SEND_MSEC_POLL 500
! #ifdef HAVE_SELECT
      fd_set        fds;
  
      FD_ZERO(&fds);
      FD_SET(ConnectionNumber(dpy), &fds);
+ #else
+     struct pollfd   fds;
+ 
+     fds.fd = ConnectionNumber(dpy);
+     fds.events = POLLIN;
  #endif
  
      time(&start);
***************
*** 593,603 ****
        // Just look out for the answer without calling back into Vim
        if (localLoop)
        {
! #ifndef HAVE_SELECT
!           if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
                break;
  #else
!           if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
                break;
  #endif
        }
--- 590,606 ----
        // Just look out for the answer without calling back into Vim
        if (localLoop)
        {
! #ifdef HAVE_SELECT
!           struct timeval  tv;
! 
!           // Set the time every call, select() may change it to the remaining
!           // time.
!           tv.tv_sec = 0;
!           tv.tv_usec =  SEND_MSEC_POLL * 1000;
!           if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
                break;
  #else
!           if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
                break;
  #endif
        }
*** ../vim-8.2.4594/src/version.c       2022-03-19 12:56:42.533503825 +0000
--- src/version.c       2022-03-20 11:06:47.419744738 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4595,
  /**/

-- 
Back up my hard drive?  I can't find the reverse switch!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220320110754.BC31A1C13D6%40moolenaar.net.

Raspunde prin e-mail lui