Fix event race

This commit is contained in:
Daniel Colascione 2014-02-24 06:27:37 -08:00
commit 7c56ecf5f5
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2014-02-24 Daniel Colascione <dancol@dancol.org>
* keyboard.c (read_char): Close race that resulted in lost events.
2014-02-22 Glenn Morris <rgm@gnu.org>
* frame.c (frame-alpha-lower-limit, frame-resize-pixelwise):

View file

@ -2891,8 +2891,12 @@ read_char (int commandflag, Lisp_Object map,
{
c = read_decoded_event_from_main_queue (end_time, local_getcjmp,
prev_event, used_mouse_menu);
if (end_time && timespec_cmp (*end_time, current_timespec ()) <= 0)
goto exit;
if (NILP(c) && end_time &&
timespec_cmp (*end_time, current_timespec ()) <= 0)
{
goto exit;
}
if (EQ (c, make_number (-2)))
{
/* This is going to exit from read_char