fix: deadlock of vnode if its state changed

This commit is contained in:
Shengliang Guan 2022-08-12 17:35:08 +08:00
parent 353109cd53
commit 646cb378ae
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,7 @@ SVnode *vnodeOpen(const char *path, STfs *pTfs, SMsgCb msgCb) {
pVnode->state.commitTerm = info.state.commitTerm;
pVnode->pTfs = pTfs;
pVnode->msgCb = msgCb;
taosInitRWLatch(&pVnode->lock);
taosThreadMutexInit(&pVnode->lock, NULL);
pVnode->blocked = false;
tsem_init(&pVnode->syncSem, 0, 0);
@ -200,6 +200,7 @@ void vnodeClose(SVnode *pVnode) {
tsem_destroy(&pVnode->syncSem);
taosThreadCondDestroy(&pVnode->poolNotEmpty);
taosThreadMutexDestroy(&pVnode->mutex);
taosThreadMutexDestroy(&pVnode->lock);
taosMemoryFree(pVnode);
}
}