summaryrefslogtreecommitdiff
path: root/src/atimer.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-10-27 14:58:08 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-10-27 14:58:08 +0200
commit4107549a614a9977cdec4cb7a1d5eaec72a3380f (patch)
tree8462aa5a9ed8f36e12e9626c6632ccf2664eae56 /src/atimer.c
parent14d835a2985379bae1540927fa422c5e35cfb792 (diff)
downloademacs-4107549a614a9977cdec4cb7a1d5eaec72a3380f.tar.gz
Always start the SIGALRM atimers
* src/atimer.c (init_atimer): Always start the SIGALRM alarms, even if we're using timerfd (bug#19776). See long, long discussion in the bug report for why this is necessary.
Diffstat (limited to 'src/atimer.c')
-rw-r--r--src/atimer.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/atimer.c b/src/atimer.c
index 9b198675ab4..802f3c6a596 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -583,15 +583,16 @@ init_atimer (void)
timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") || have_buggy_timerfd () ? -1 :
timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC));
# endif
- if (timerfd < 0)
- {
- struct sigevent sigev;
- sigev.sigev_notify = SIGEV_SIGNAL;
- sigev.sigev_signo = SIGALRM;
- sigev.sigev_value.sival_ptr = &alarm_timer;
- alarm_timer_ok
- = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0;
- }
+ /* We're starting the alarms even if we have timerfd, because
+ timerfd events do not fired while Emacs Lisp is busy. This might
+ or might not mean that the timerfd code doesn't really give us
+ anything and should be removed, see discussion in bug#19776. */
+ struct sigevent sigev;
+ sigev.sigev_notify = SIGEV_SIGNAL;
+ sigev.sigev_signo = SIGALRM;
+ sigev.sigev_value.sival_ptr = &alarm_timer;
+ alarm_timer_ok
+ = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0;
#endif
free_atimers = stopped_atimers = atimers = NULL;