public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [PATCH v2] nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029)
Date: Tue, 19 Apr 2022 12:46:54 +0000	[thread overview]
Message-ID: <Yl6vPkO02ww0M6Q7@arm.com> (raw)
In-Reply-To: <5963984e-1185-0c65-b565-5485299eac39@linaro.org>

The 04/19/2022 09:30, Adhemerval Zanella wrote:
> Do this fix the intermittent issue you are seeing:
> 

yes, this seems to fix the issue.

> diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c
> index c76882e279..e67b2df5cc 100644
> --- a/nptl/pthread_cancel.c
> +++ b/nptl/pthread_cancel.c
> @@ -121,6 +121,7 @@ __pthread_cancel (pthread_t th)
>    int newval;
>    do
>      {
> +    again:
>        newval = oldval | CANCELING_BITMASK | CANCELED_BITMASK;
>        if (oldval == newval)
>         break;
> @@ -134,7 +135,7 @@ __pthread_cancel (pthread_t th)
>           int newval2 = oldval | CANCELING_BITMASK;
>           if (!atomic_compare_exchange_weak_acquire (&pd->cancelhandling,
>                                                      &oldval, newval2))
> -           continue;
> +           goto again;
>  
>           if (pd == THREAD_SELF)
>             /* This is not merely an optimization: An application may
> 
>     

  reply	other threads:[~2022-04-19 12:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 15:49 Adhemerval Zanella
2022-04-14 18:26 ` Adhemerval Zanella
2022-04-19 10:44 ` Szabolcs Nagy
2022-04-19 12:18   ` Adhemerval Zanella
2022-04-19 12:23     ` Adhemerval Zanella
2022-04-19 12:10 ` Szabolcs Nagy
2022-04-19 12:30   ` Adhemerval Zanella
2022-04-19 12:46     ` Szabolcs Nagy [this message]
2022-04-19 13:12       ` Adhemerval Zanella
2022-07-12 21:27 ` Noah Goldstein
2022-07-12 21:28   ` Noah Goldstein
2022-07-13 12:57   ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yl6vPkO02ww0M6Q7@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=aurelien@aurel32.net \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).