emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: igc, macOS avoiding signals


From: Eli Zaretskii
Subject: Re: igc, macOS avoiding signals
Date: Tue, 31 Dec 2024 15:18:21 +0200

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  pipcet@protonmail.com,
>   spd@toadstyle.org,  emacs-devel@gnu.org
> Date: Tue, 31 Dec 2024 10:19:15 +0100
> 
> Helmut Eller <eller.helmut@gmail.com> writes:
> 
> > Except the POSIX police: it says that pthread_mutex_trylock isn't async
> > signal safe.  I suppose this also makes it's unsafe to use MPS's fault
> > handler in an async signal handler.  Bummer.  (Does the police take
> > bribes?)
> 
> Thanks. I guess it shows that I couldn't keep up with my mail, sorry for
> that.
> 
> So we have this picture, I think
> 
>               t1           t2                    t3
>   ------------|------------|---------------------|-----------------> t
>    signal        pthread      other stuff          signal handler
>    handler       trylock      until return to      branching
>    calling                    signal handler       on result of busy
>    mps_arena_
>    busy
> 
> We have a window [t1, t2] where the nested signals lead to undefined
> behavior. and [t2, t3] where threads and nested signals can come into
> play, but that's not a problem, iff signal handlers don't leave a lock
> behind them.

If the problem is other signals in [t1, t2], we could install the
signal handler in a way that masks all other signals while the handler
runs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]