[PATCH 8/8] Cygwin: signal: Fix another deadlock between main and sig thread
Takashi Yano
takashi.yano@nifty.ne.jp
Thu Nov 28 11:26:24 GMT 2024
On Wed, 27 Nov 2024 18:02:52 +0100
Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> On Nov 27 20:22, Takashi Yano wrote:
> > In _cygtls::handle_SIGCONT(), the sig thread waits for the main thread
> > processing the signal without unlocking tls area. This causes a deadlock
> > if the main thread tries to acquire a lock for the tls area meanwhile.
> > With this patch, unlock tls before calling yield() in handle_SIGCONT().
> >
> > Addresses: https://cygwin.com/pipermail/cygwin/2024-November/256744.html
> > Fixes: 26158dc3e9c2("* exceptions.cc (sigpacket::process): Lock _cygtls area of thread before accessing it.")
> > Reported-by: Christian Franke <Christian.Franke@t-online.de>
> > Reviewed-by:
> > Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
> > ---
> > winsup/cygwin/exceptions.cc | 10 +++++++---
> > winsup/cygwin/local_includes/cygtls.h | 4 +++-
> > 2 files changed, 10 insertions(+), 4 deletions(-)
>
> LGTM.
Thanks! Pushed to main branch.
--
Takashi Yano <takashi.yano@nifty.ne.jp>
More information about the Cygwin-patches
mailing list