This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix generic std::atomic<T>::compare_exchange_{weak,strong}



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]