Subject: Re: bug#75275: 30.0.92; `make-thread` bug on macOS 15.2

From: Eli Zaretskii <[email-masked]>
Date: Thu, 02 Jan 2025 10:55:32 +0200

> From: Gerd Möllmann <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Thu, 02 Jan 2025 09:41:38 +0100
> 
> Gerd Möllmann <[email-masked]> writes:
> 
> > Eli Zaretskii <[email-masked]> writes:
> >
> >> So should we add a condition before calling [NSApp run] that we are in
> >> the main thread?
> >
> > ATM, I don't understand how we land in that line in ns_select_1 if not
> > [NSThread isMainThread]. Maybe I need new glasses. I asked Stefan if he
> > can see something in LLDB.
> 
> It must something in here:
> 
>   if (![NSThread isMainThread]
>       || (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0))
>     thread_select (pselect, nfds, readfds, writefds,
> 		   exceptfds, timeout, sigmask);
> 
> Should we return here?

I don't know.  Is there anything in the following code that can be
relevant to a non-main thread?  Note that non-main threads can
legitimately call wait_reading_process_output, which calls ns_select.
For example, what happens if a non-main Lisp thread starts a
sub-process? we do expect to be able to read the output from that
sub-process.