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

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


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.




More information about the Libstdc++ mailing list