From c5a4f4c8d0097e02c380967fc7a3a2b39bb78a53 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Thu, 14 Dec 2017 15:07:18 -0800 Subject: [PATCH] Use explicit memory order in Baton::post Summary: [Folly] Use explicit memory order in `Baton::post`. Reviewed By: djwatson Differential Revision: D6502268 fbshipit-source-id: a379ea711f165e3645ac2127a49824f46225b80a --- folly/synchronization/Baton.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/folly/synchronization/Baton.h b/folly/synchronization/Baton.h index 379f9021..96b34661 100644 --- a/folly/synchronization/Baton.h +++ b/folly/synchronization/Baton.h @@ -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; } -- 2.34.1