[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

Jonathan Wakely jwakely@redhat.com
Tue Apr 20 13:28:27 GMT 2021

On 20/04/21 14:20 +0100, Jonathan Wakely wrote:
>On 20/04/21 13:02 +0100, Jonathan Wakely wrote:
>>On 19/04/21 12:23 -0700, Thomas Rodgers wrote:
>>>+	template<typename _Up, typename _ValFn,
>>>+		 typename _Spin = __default_spin_policy>
>>>+	  static bool
>>>+	  _S_do_spin_v(__platform_wait_t* __addr,
>>>+		       const _Up& __old, _ValFn __vfn,
>>>+		       __platform_wait_t& __val,
>>>+		       _Spin __spin = _Spin{ })
>>>+	  {
>>>+	    auto const __pred = [=]
>>>+	      { return __atomic_compare(__old, __vfn()); };
>>This doesn't compile, there are 28 FAILs in 29_atomics/*
>>FAIL: 29_atomics/atomic_integral/cons/value_init.cc (test for excess errors)
>>It needs to be qualified as __detail::__atomic_compare.
>Ah no, the problem is that atomic_flag::wait uses it, but it tries to
>compare a bool to atomic_flag::__atomic_flag_data_type, which isn't
>the same.

And this on solaris:

FAIL: 29_atomics/atomic_integral/cons/value_init.cc (test for excess errors)
Excess errors:
/export/home/jwakely/build/sparc-sun-solaris2.11/libstdc++-v3/include/bits/atomic_wait.h:263: error: '_M_addr' was not declared in this scope; did you mean '__addr'?
/export/home/jwakely/build/sparc-sun-solaris2.11/libstdc++-v3/include/bits/atomic_wait.h:263: error: argument 1 of '__atomic_load' must be a non-void pointer type

UNRESOLVED: 29_atomics/atomic_integral/cons/value_init.cc compilation failed to produce executable

Just a typo, but I don't think we can push this to gcc-11 at this
late stage.

More information about the Libstdc++ mailing list