Avoid unnecessary memory fences
Former-commit-id: 88962af8b2fe835fb5d542013062cec8c771c6c6
This commit is contained in:
parent
19a4d2d358
commit
418b6206ea
@ -258,20 +258,22 @@ int prepareClientToWrite(client *c) {
|
|||||||
serverAssert(GlobalLocksAcquired());
|
serverAssert(GlobalLocksAcquired());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->flags & CLIENT_FORCE_REPLY) return C_OK; // FORCE REPLY means we're doing something else with the buffer.
|
auto flags = c->flags.load(std::memory_order_relaxed);
|
||||||
|
|
||||||
|
if (flags & CLIENT_FORCE_REPLY) return C_OK; // FORCE REPLY means we're doing something else with the buffer.
|
||||||
// do not install a write handler
|
// do not install a write handler
|
||||||
|
|
||||||
/* If it's the Lua client we always return ok without installing any
|
/* If it's the Lua client we always return ok without installing any
|
||||||
* handler since there is no socket at all. */
|
* handler since there is no socket at all. */
|
||||||
if (c->flags & (CLIENT_LUA|CLIENT_MODULE)) return C_OK;
|
if (flags & (CLIENT_LUA|CLIENT_MODULE)) return C_OK;
|
||||||
|
|
||||||
/* CLIENT REPLY OFF / SKIP handling: don't send replies. */
|
/* CLIENT REPLY OFF / SKIP handling: don't send replies. */
|
||||||
if (c->flags & (CLIENT_REPLY_OFF|CLIENT_REPLY_SKIP)) return C_ERR;
|
if (flags & (CLIENT_REPLY_OFF|CLIENT_REPLY_SKIP)) return C_ERR;
|
||||||
|
|
||||||
/* Masters don't receive replies, unless CLIENT_MASTER_FORCE_REPLY flag
|
/* Masters don't receive replies, unless CLIENT_MASTER_FORCE_REPLY flag
|
||||||
* is set. */
|
* is set. */
|
||||||
if ((c->flags & CLIENT_MASTER) &&
|
if ((flags & CLIENT_MASTER) &&
|
||||||
!(c->flags & CLIENT_MASTER_FORCE_REPLY)) return C_ERR;
|
!(flags & CLIENT_MASTER_FORCE_REPLY)) return C_ERR;
|
||||||
|
|
||||||
if (!c->conn) return C_ERR; /* Fake client for AOF loading. */
|
if (!c->conn) return C_ERR; /* Fake client for AOF loading. */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user