public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ville Voutilainen <ville.voutilainen@gmail.com>
To: Paul Scharnofske <asynts@gmail.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: std::jthread::operator=(std::jthread&&) calls std::terminate if *this has an associated running thread.
Date: Fri, 6 Nov 2020 23:35:06 +0200	[thread overview]
Message-ID: <CAFk2RUaQXGkWFc6KU3SRuROvntgYK9R+ABa_CYLVvFnSMYnrtg@mail.gmail.com> (raw)
In-Reply-To: <7388faf6-f5e9-1328-cbe5-e8634e092561@gmail.com>

On Fri, 6 Nov 2020 at 23:14, Paul Scharnofske via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>      +          // The C++ Standard (working draft) says that this
> method must be
>      +          // noexcept, but also dictates that join be called. It
> doesn't say
>      +          // how to do this, this is probably the way to go?
>      +          try
>      +            {
>      +              join();
>      +            }
>      +          catch (...)
>      +            {
>      +              std::terminate();
>      +            }
>      +        }

Just calling join() will have the same effect, without having to
bother with the additional catching.

  reply	other threads:[~2020-11-06 21:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 21:13 Paul Scharnofske
2020-11-06 21:35 ` Ville Voutilainen [this message]
2020-11-06 21:49   ` Paul Scharnofske
2020-11-06 22:02 ` Jonathan Wakely
2020-11-08 13:51 ` Paul Scharnofske
2020-11-11 11:15   ` Jonathan Wakely

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=CAFk2RUaQXGkWFc6KU3SRuROvntgYK9R+ABa_CYLVvFnSMYnrtg@mail.gmail.com \
    --to=ville.voutilainen@gmail.com \
    --cc=asynts@gmail.com \
    --cc=libstdc++@gcc.gnu.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).