Subject: Re: bug#79228: 30.1.90; native--compile-async sentinel can error if threads are running

From: Eli Zaretskii <[email-masked]>
Date: Mon, 01 Sep 2025 22:07:16 +0300

> From: Spencer Baugh <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Mon, 01 Sep 2025 12:03:21 -0400
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> 1. emacs -Q
> >> 2. Run some command which starts a thread
> >> 3. Run some command which starts native compilation
> >> 
> >> Native compilation is done via pending_funcalls.  pending_funcalls can
> >> be run in the non-main thread started by 2.
> >
> > How?
> 
> Because pending_funcalls is run by timer_check_2, which is run by
> timer_check, which is run by wait_reading_process_output, which can be
> run by non-main threads.

So maybe we should run timers only in the main thread?

> >> Thus the native compilation can happen in a non-main thread.
> >
> > So step 3 is not necessary?
> 
> It's necesary because, of course, if nothing causes native compilation
> to happen, native compilation won't happen.

Native compilation can be triggered by loading a Lisp package which
doesn't yet have a .eln file.