Use explicit memory order in Baton::post
[folly.git] / folly / synchronization / Baton.h
index 379f9021f646e939e4cdc485491f3b37c537ba3f..96b3466169b560f339168a0cbaecca9e537ae8be 100644 (file)
@@ -128,7 +128,11 @@ struct Baton {
     assert(before == INIT || before == WAITING || before == TIMED_OUT);
 
     if (before == INIT &&
-        state_.compare_exchange_strong(before, EARLY_DELIVERY)) {
+        state_.compare_exchange_strong(
+            before,
+            EARLY_DELIVERY,
+            std::memory_order_release,
+            std::memory_order_relaxed)) {
       return;
     }