diff options
| author | Lars Ingebrigtsen | 2021-10-27 14:58:08 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-10-27 14:58:08 +0200 |
| commit | 4107549a614a9977cdec4cb7a1d5eaec72a3380f (patch) | |
| tree | 8462aa5a9ed8f36e12e9626c6632ccf2664eae56 /src | |
| parent | 14d835a2985379bae1540927fa422c5e35cfb792 (diff) | |
| download | emacs-4107549a614a9977cdec4cb7a1d5eaec72a3380f.tar.gz emacs-4107549a614a9977cdec4cb7a1d5eaec72a3380f.zip | |
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')
| -rw-r--r-- | src/atimer.c | 19 |
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) | |||
| 583 | timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") || have_buggy_timerfd () ? -1 : | 583 | timerfd = (egetenv ("EMACS_IGNORE_TIMERFD") || have_buggy_timerfd () ? -1 : |
| 584 | timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC)); | 584 | timerfd_create (CLOCK_REALTIME, TFD_NONBLOCK | TFD_CLOEXEC)); |
| 585 | # endif | 585 | # endif |
| 586 | if (timerfd < 0) | 586 | /* We're starting the alarms even if we have timerfd, because |
| 587 | { | 587 | timerfd events do not fired while Emacs Lisp is busy. This might |
| 588 | struct sigevent sigev; | 588 | or might not mean that the timerfd code doesn't really give us |
| 589 | sigev.sigev_notify = SIGEV_SIGNAL; | 589 | anything and should be removed, see discussion in bug#19776. */ |
| 590 | sigev.sigev_signo = SIGALRM; | 590 | struct sigevent sigev; |
| 591 | sigev.sigev_value.sival_ptr = &alarm_timer; | 591 | sigev.sigev_notify = SIGEV_SIGNAL; |
| 592 | alarm_timer_ok | 592 | sigev.sigev_signo = SIGALRM; |
| 593 | = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0; | 593 | sigev.sigev_value.sival_ptr = &alarm_timer; |
| 594 | } | 594 | alarm_timer_ok |
| 595 | = timer_create (CLOCK_REALTIME, &sigev, &alarm_timer) == 0; | ||
| 595 | #endif | 596 | #endif |
| 596 | free_atimers = stopped_atimers = atimers = NULL; | 597 | free_atimers = stopped_atimers = atimers = NULL; |
| 597 | 598 | ||