]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Implement std::atomic<T*>::compare_exchange_weak
authorJonathan Wakely <jwakely@redhat.com>
Thu, 2 Sep 2021 15:47:31 +0000 (16:47 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 2 Sep 2021 17:22:33 +0000 (18:22 +0100)
commit89cf858571c58a58ca51dbbf3975582ebab41e2d
treec44a628d4ce857d2c8e0fe9473f59852c85a9f91
parent892400f1f21ccee98dddcd90677038ce266248c8
libstdc++: Implement std::atomic<T*>::compare_exchange_weak

For some reason r170217 didn't add compare_exchange_weak to the
__atomic_base<T*> partial specialization, and so weak compare exchange
operations on pointers use compare_exchange_strong instead.

This adds __atomic_base<T*>::compare_exchange_weak and then uses it in
std::atomic<T*>::compare_exchange_weak.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/bits/atomic_base.h (__atomic_base<P*>::compare_exchange_weak):
Add new functions.
* include/std/atomic (atomic<T*>::compare_exchange_weak): Use
it.
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/std/atomic