From f275456439250ac45bb50b4aa6b211075f4c873a Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 13 Oct 2020 06:35:16 +0000 Subject: [PATCH] Relax memory order where possible Former-commit-id: 3e996035ea1d5a40d02f84e916837a1d350b844b --- src/networking.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/networking.cpp b/src/networking.cpp index f117839b2..14b6a4428 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -293,7 +293,7 @@ int prepareClientToWrite(client *c, bool fAsync) { * -------------------------------------------------------------------------- */ int _addReplyToBuffer(client *c, const char *s, size_t len, bool fAsync) { - if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return C_OK; + if (c->flags.load(std::memory_order_relaxed) & CLIENT_CLOSE_AFTER_REPLY) return C_OK; fAsync = fAsync && !FCorrectThread(c); // Not async if we're on the right thread if (fAsync) @@ -327,7 +327,7 @@ int _addReplyToBuffer(client *c, const char *s, size_t len, bool fAsync) { } void _addReplyProtoToList(client *c, const char *s, size_t len) { - if (c->flags & CLIENT_CLOSE_AFTER_REPLY) return; + if (c->flags.load(std::memory_order_relaxed) & CLIENT_CLOSE_AFTER_REPLY) return; AssertCorrectThread(c); listNode *ln = listLast(c->reply);