public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Thomas Rodgers <trodgers@redhat.com>
Cc: Thomas Rodgers <rodgert@appliantology.com>,
	gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Add C++2a synchronization support
Date: Tue, 29 Sep 2020 10:44:46 +0100	[thread overview]
Message-ID: <20200929094446.GK3946@redhat.com> (raw)
In-Reply-To: <xkqetuvhio8i.fsf@trodgers.remote>

On 28/09/20 14:29 -0700, Thomas Rodgers wrote:
>>>+    template<typename _Duration>
>>>+      __atomic_wait_status
>>>+      __platform_wait_until_impl(__platform_wait_t* __addr,
>>>+				 __platform_wait_t __val,
>>>+				 const chrono::time_point<__platform_wait_clock_t,
>>>+							  _Duration>& __atime) noexcept
>>>+      {
>>>+	auto __s = chrono::time_point_cast<chrono::seconds>(__atime);
>>>+	auto __ns = chrono::duration_cast<chrono::nanoseconds>(__atime - __s);
>>>+
>>>+	struct timespec __rt =
>>>+	{
>>>+	  static_cast<std::time_t>(__s.time_since_epoch().count()),
>>>+	  static_cast<long>(__ns.count())
>>>+	};
>>>+
>>>+	auto __e = syscall (SYS_futex, __addr,
>>>+			      static_cast<int>(__futex_wait_flags::__wait_bitset_private),
>>>+			      __val, &__rt, nullptr,
>>>+			      static_cast<int>(__futex_wait_flags::__bitset_match_any));
>>>+	if (__e && !(errno == EINTR || errno == EAGAIN || errno == ETIMEDOUT))
>>>+	    std::terminate();
>>>+	return (__platform_wait_clock_t::now() < __atime)
>>>+	       ? __atomic_wait_status::no_timeout : __atomic_wait_status::timeout;
>>>+      }
>>>+
>>>+    template<typename _Clock, typename _Duration>
>>>+      __atomic_wait_status
>>>+      __platform_wait_until(__platform_wait_t* __addr, __platform_wait_t __val,
>>>+			    const chrono::time_point<_Clock, _Duration>& __atime)
>>>+      {
>>>+	if constexpr (is_same_v<__platform_wait_clock_t, _Clock>)
>>
>> This case is impossible, since the other overload would be selected
>> if the clock is the __platform_wait_clock_t (unless the caller says
>> __platform_wait_until<__platform_wait_until> to explicitly call this
>> overload, but users can't call this function, and we won't do that).
>>
>
>Which overload?


I must have misread __platform_wait_until_impl above as
__platform_wait_until. Ignore this comment, sorry!



  reply	other threads:[~2020-09-29  9:44 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10  0:01 [PATCH] " Thomas Rodgers
2020-05-11 14:05 ` Jonathan Wakely
2020-05-11 15:43   ` Thomas Rodgers
2020-05-11 17:05     ` Jonathan Wakely
2020-05-11 20:59   ` Thomas Rodgers
2020-05-23 22:52     ` Thomas Rodgers
2020-05-24 17:41       ` Thomas Rodgers
2020-06-06  0:29       ` Thomas Rodgers
2020-07-08 16:43         ` Jonathan Wakely
2020-08-03 14:09         ` Jonathan Wakely
2020-08-03 20:19           ` Jonathan Wakely
2020-09-03  0:47             ` Thomas Rodgers
2020-09-03  0:54               ` Thomas Rodgers
2020-09-11 23:58                 ` [PATCH] libstdc++: " Thomas Rodgers
2020-09-28 13:25                   ` Jonathan Wakely
2020-10-01 23:37                     ` Thomas Rodgers
2020-10-02 15:40                       ` Thomas Rodgers
2020-10-05 22:54                       ` [PATCH] t/trodgers/c2a_synchronization Thomas Rodgers
2020-10-23 10:28                         ` Jonathan Wakely
2020-10-26 21:48                           ` [PATCH] libstdc++: Add C++2a synchronization support Thomas Rodgers
2020-10-27 10:23                             ` Jonathan Wakely
2020-11-20 22:44                               ` Thomas Rodgers
2020-11-22 21:13                                 ` Stephan Bergmann
2020-11-23 18:33                                   ` Jonathan Wakely
2020-11-22 21:41                                 ` Stephan Bergmann
2020-11-23 18:32                                   ` Jonathan Wakely
2020-11-21 15:16                             ` Andreas Schwab
2020-11-21 17:04                               ` Jonathan Wakely
2020-11-21 17:39                                 ` Jonathan Wakely
2020-11-22  0:36                                   ` H.J. Lu
2020-11-23 14:50                                     ` Jonathan Wakely
2020-11-24 23:45                                     ` Jonathan Wakely
2020-11-25  1:07                                       ` Jonathan Wakely
2020-11-25 10:35                                         ` Jonathan Wakely
2020-11-25 12:32                                           ` Jonathan Wakely
2020-11-25 18:39                                           ` Jonathan Wakely
2020-11-26 16:26                                             ` Jonathan Wakely
2020-11-23 16:08                                   ` Jonathan Wakely
2020-09-28 13:30                   ` Jonathan Wakely
2020-09-28 13:36                   ` Jonathan Wakely
2020-09-28 21:29                     ` Thomas Rodgers
2020-09-29  9:44                       ` Jonathan Wakely [this message]
2020-11-21 23:54 David Edelsohn
2020-11-22  1:27 ` Jonathan Wakely
2020-11-22 12:29   ` Iain Sandoe
2020-11-22 13:37     ` Jonathan Wakely
2020-11-23 18:31       ` Jonathan Wakely
2020-11-23 18:31         ` Jonathan Wakely
2020-11-24  1:48         ` David Edelsohn
2020-11-23 18:30   ` 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=20200929094446.GK3946@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=rodgert@appliantology.com \
    --cc=trodgers@redhat.com \
    /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).