std::atomic_flag::test
Jonathan Wakely
jwakely@redhat.com
Mon May 11 08:11:19 GMT 2020
On 08/05/20 17:05 +0200, Ulrich Drepper via Libstdc++ wrote:
>This is not yet implemented. Here is a patch.
>
>2020-05-08 Ulrich Drepper <drepper@redhat.com>
>
> * include/bits/atomic_base.h (atomic_flag): Implement test
>memeber function.
> * include/std/version: Define __cpp_lib_atomic_flag_test.
> * testsuite/29_atomics/atomic_flag/test/explicit.cc: New file.
> * testsuite/29_atomics/atomic_flag/test/implicit.cc: New file.
>
>
>
>libatomic does not have a function 'test' so I implemented it with
>__atomic_load (which takes care of memory ordering) and then compare
>with the set-value.
>
>The code generated at least for x86-64 looks good, it's a
>straight-forward load, nothing else.
Thanks, looks good for master.
More information about the Gcc-patches
mailing list