On Thu, 3 Apr 2025, Johannes Schindelin wrote:

> I still have a question that I would like to be answered in the commit
> message, too:
>
> If `signal_arrived` is only initialized in `fixup_after_fork()` but user
> callbacks that use this are called by `atforkchild()`, why did this not
> trigger _all the time_ before your reordering of the calls?

Based on my recollections, Takashi probably knows better

1) there has to be a pthread_atfork child callback registered
2) this callback has to call raw_write
3) raw_write now calls cygwait (which is now reenterancy-safe due to other
fallout from this)
4) cygwait allows signals to be processed, so needs the signal-handling
stuff to be properly initialized.

I'm guessing, if raw_write doesn't need to wait (ie, there's room in the
pipe for the write) it doesn't hit the signal stuff.

But I get your request for explaining the scenario in the commit message.

Reply via email to