mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-20 18:17:20 +00:00
(XTflash): Make the timeout of select shorter, and call
select repeatedly until the desired time expires.
This commit is contained in:
parent
45d051a764
commit
101922c35f
@ -1,3 +1,8 @@
|
||||
2001-03-06 Kenichi Handa <handa@etl.go.jp>
|
||||
|
||||
* xterm.c (XTflash): Make the timeout of select shorter, and call
|
||||
select repeatedly until the desired time expires.
|
||||
|
||||
2001-03-06 Gerd Moellmann <gerd@gnu.org>
|
||||
|
||||
* w32fns.c (Fx_create_frame): Clear Vwindow_list.
|
||||
|
17
src/xterm.c
17
src/xterm.c
@ -5437,18 +5437,23 @@ XTflash (f)
|
||||
wakeup.tv_sec += (wakeup.tv_usec / 1000000);
|
||||
wakeup.tv_usec %= 1000000;
|
||||
|
||||
/* Keep waiting until past the time wakeup. */
|
||||
while (1)
|
||||
/* Keep waiting until past the time wakeup or any input gets
|
||||
available. */
|
||||
while (! detect_input_pending ())
|
||||
{
|
||||
struct timeval current;
|
||||
struct timeval timeout;
|
||||
|
||||
EMACS_GET_TIME (timeout);
|
||||
EMACS_GET_TIME (current);
|
||||
|
||||
/* In effect, timeout = wakeup - timeout.
|
||||
Break if result would be negative. */
|
||||
if (timeval_subtract (&timeout, wakeup, timeout))
|
||||
/* Break if result would be negative. */
|
||||
if (timeval_subtract (¤t, wakeup, current))
|
||||
break;
|
||||
|
||||
/* How long `select' should wait. */
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 10000;
|
||||
|
||||
/* Try to wait that long--but we might wake up sooner. */
|
||||
select (0, NULL, NULL, NULL, &timeout);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user