feature/qnode
This commit is contained in:
parent
c524647b96
commit
26c2f31341
|
@ -213,6 +213,8 @@ typedef struct SCtgAction {
|
||||||
|
|
||||||
#define TD_RWLATCH_WRITE_FLAG_COPY 0x40000000
|
#define TD_RWLATCH_WRITE_FLAG_COPY 0x40000000
|
||||||
|
|
||||||
|
#define CTG_IS_LOCKED(_lock) atomic_load_32((_lock))
|
||||||
|
|
||||||
#define CTG_LOCK(type, _lock) do { \
|
#define CTG_LOCK(type, _lock) do { \
|
||||||
if (CTG_READ == (type)) { \
|
if (CTG_READ == (type)) { \
|
||||||
assert(atomic_load_32((_lock)) >= 0); \
|
assert(atomic_load_32((_lock)) >= 0); \
|
||||||
|
|
|
@ -2431,6 +2431,10 @@ void catalogDestroy(void) {
|
||||||
|
|
||||||
tsem_post(&gCtgMgmt.sem);
|
tsem_post(&gCtgMgmt.sem);
|
||||||
|
|
||||||
|
while (CTG_IS_LOCKED(&gCtgMgmt.lock)) {
|
||||||
|
usleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
CTG_LOCK(CTG_WRITE, &gCtgMgmt.lock);
|
CTG_LOCK(CTG_WRITE, &gCtgMgmt.lock);
|
||||||
|
|
||||||
SCatalog *pCtg = NULL;
|
SCatalog *pCtg = NULL;
|
||||||
|
|
Loading…
Reference in New Issue