review rework

This commit is contained in:
a00817524 2023-09-08 19:29:21 +00:00 committed by John Sully
parent cf13e7b594
commit 337eb297a1

View File

@ -183,9 +183,11 @@ void aeProcessCmd(aeEventLoop *eventLoop, int fd, void *, int )
}
case AE_ASYNC_OP::PostAsynDBFunction:
{ //added to support async api IStorage
std::unique_lock<decltype(g_lock)> ulock(g_lock, std::defer_lock);
if (cmd.fLock)
ulock.lock();
if (cmd.fLock && !ulock.owns_lock()) {
g_forkLock.releaseRead();
ulock.lock();
g_forkLock.acquireRead();
}
((aePostFunctionTokenProc*)cmd.tproc)(eventLoop,(StorageToken*)cmd.clientData);
break;
}