Extract compare-exchange hack under TSAN
Summary: [Folly] Extract compare-exchange hack under TSAN to a common location and make its interface mimic `std::atomic_compare_exchange_strong_explicit`. Limit it to Clang TSAN (no knowledge of whether it applies to other implementations of TSAN), but extend it to handle all pairs of success and failure orders. The TSAN bug is described in https://github.com/google/sanitizers/issues/970. High level, Clang TSAN ignores the explicit failure order and infers a failure order from the success order - which is broken if the explicit failure order is in the relevant sense stronger than the success order. Reviewed By: aary, nbronson Differential Revision: D16854217 fbshipit-source-id: 18f6458520bbd5f482e41c10d7229e6cfae1db2a
Showing
Please register or sign in to comment