add correct thread assert to client::asyncCommand

Former-commit-id: a892fb4d551fb58d619bc80c333a6b3a9ed34215
This commit is contained in:
malavan 2021-08-26 14:23:13 +00:00
parent 3a04d0a31b
commit f3921035f5

View File

@ -4956,6 +4956,7 @@ bool client::asyncCommand(std::function<void *(const redisDbPersistentDataSnapsh
std::function<void(const redisDbPersistentDataSnapshot *, void *)> &&mainFn,
std::function<void(const redisDbPersistentDataSnapshot *, void *)> &&postFn)
{
serverAssert(FCorrectThread(this));
const redisDbPersistentDataSnapshot *snapshot = nullptr;
if (!(this->flags & (CLIENT_MULTI | CLIENT_BLOCKED)))
snapshot = this->db->createSnapshot(this->mvccCheckpoint, false /* fOptional */);
@ -4963,7 +4964,6 @@ bool client::asyncCommand(std::function<void *(const redisDbPersistentDataSnapsh
return false;
}
aeEventLoop *el = serverTL->el;
serverAssert(FCorrectThread(this));
blockClient(this, BLOCKED_ASYNC);
g_pserver->asyncworkqueue->AddWorkFunction([el, this, preFn, mainFn, postFn, snapshot] {
void *preData = preFn(snapshot);