feature/qnode

This commit is contained in:
dapan1121 2022-02-14 10:58:33 +08:00
parent c524647b96
commit 26c2f31341
2 changed files with 6 additions and 0 deletions

View File

@ -213,6 +213,8 @@ typedef struct SCtgAction {
#define TD_RWLATCH_WRITE_FLAG_COPY 0x40000000
#define CTG_IS_LOCKED(_lock) atomic_load_32((_lock))
#define CTG_LOCK(type, _lock) do { \
if (CTG_READ == (type)) { \
assert(atomic_load_32((_lock)) >= 0); \

View File

@ -2431,6 +2431,10 @@ void catalogDestroy(void) {
tsem_post(&gCtgMgmt.sem);
while (CTG_IS_LOCKED(&gCtgMgmt.lock)) {
usleep(1);
}
CTG_LOCK(CTG_WRITE, &gCtgMgmt.lock);
SCatalog *pCtg = NULL;