This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] fix generic std::atomic<T>::compare_exchange_{weak,strong}
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Nathan Froyd <nfroyd at mozilla dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Jul 2013 19:58:35 +0200
- Subject: Re: [PATCH] fix generic std::atomic<T>::compare_exchange_{weak,strong}
- References: <20130726173426 dot GA11900 at cerebro>
Hi,
Nathan Froyd <nfroyd@mozilla.com> ha scritto:
>Compiling the test program:
>
>#include <atomic>
>
>enum x { a, b };
>
>std::atomic<x> v;
>
>bool test_strong()
>{
> x expected = a;
>return v.compare_exchange_strong(expected, b,
>std::memory_order_acq_rel);
>}
>
>bool test_weak()
>{
> x expected = a;
>return v.compare_exchange_weak(expected, b, std::memory_order_acq_rel);
>}
In any case, why not adding the testcase?
Paolo